0

I wanted to make a vim snippet in my vimrc, without using a plugin. I want it to appear automatically when I type Ctrl-N

iabbrev was good for short code addition, as mentioned in this post https://vim.fandom.com/wiki/Use_abbreviations_for_frequently-used_words

I did not understand the set complete += '/user/completion file'

I thought I would have a list of words in that file and vim adds it with Ctrl-N, but it did not work.

Can I get suggestion when I type Ctrl-N

0

1 Answer 1

0

'complete' is not a list of files, but a list of flags that describe where to source completions from. Specifically, you want the k flag:

From :help 'complete'

k scan the files given with the 'dictionary' option

So, like the link you provided suggests, you'll want to add the k flag to 'complete' and then add your dictionary files to 'dictionary':

set complete+=k
set dictionary+=/path/to/dictionary

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.