-
Notifications
You must be signed in to change notification settings - Fork 66
Using ncm2 for link completion #163
Copy link
Copy link
Closed
Description
The docs only discuss making ncm2 aware of the syntax subscopes in a wiki, but don't say anything about using ncm2 for completing links.
In case this is of any value to others, the following registers wiki.vim's omnicomplete function as a source for ncm2:
autocmd User WikiBufferInitialized call ncm2#register_source({
\ 'name': 'wiki',
\ 'priority': 9,
\ 'scope': ['wiki'],
\ 'word_pattern': '\w+',
\ 'complete_pattern': '\[\[',
\ 'on_complete': ['ncm2#on_complete#delay', 200,
\ 'ncm2#on_complete#omni',
\ 'wiki#complete#omnicomplete'],
\ })This allows wiki-style links to be autocompleted (but not markdown-style links). Perhaps this could be added to the documentation? Or should this be put into a separate ncm2-wiki.vim plugin (like many ncm2 plugin sources are)?
(This is also my first time adding a source to ncm2 so any feedback is appreciated.)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels