felko / neuron-mode

An emacs mode for editing Zettelkasten notes with neuron

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Link autocomplete by title

srid opened this issue · comments

Emacs already autocompletes some (if not all?) IDs by default:

image

I don't know the mechanism behind it. It did however make me think it would be really nice if that autocomplete popup displayed the actual title of the zettels. So the user can just type some characters from the title (just as they do in neuron search) of the zettel they want to link to, and Emacs will auto-complete that. It would be a bonus if the user can also directly create and link to a new zettel by typing its title (autocomplete list would be empty, because no existing zettels would match for the new title) and then hitting Enter.


Stealing ideas from Roam:

image

I think you can just use neuron-insert-zettel-link.

commented

neuron-insert-zettel-link is good enough for me, but some people might prefer title autocompletion, which doesn't even require the user to type a keybinding. The issue I am encountering when implementing this is that company seems to filter results by prefix only, which isn't really convenient when trying to search a zettel unless you know exactly the title. There might be more sophisticated ways to handle autocomplete (e.g. fuzzy matching) but I haven't found a way to do it yet.

commented

Finally implemented in 769a4b9, at the cost of adding a dependency on company.