Skip to content

How to get nvim cmp to maintain the completion list when items have spaces? #272

Answered by epwalsh
Feel-ix-343 asked this question in Q&A
Discussion options

You must be logged in to vote

Hey @Feel-ix-343, getting completion to work properly was by far the hardest part of building this plugin. nvim-cmp is not documented very well so it was a lot of trial and error. Obsidian registers 3 different completion sources, and the easiest to understand is probably cmp_obsidian_new (for creating new notes). I think the key piece that makes it work with spaces is the source.get_keyword_pattern() function, which comes from here. That's a Vim pattern, by the way, not a Lua pattern.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by Feel-ix-343
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants