When I have syntax on in a large C file (about 8000) lines
the completion ctrl-p and ctrl-n are very slow (more than 20). When I turn syntax off then completion takes less than a second.
I figured out a minimal way of reproducing this behaviour. Use an empty .vim folder and create a .vimrc with only these lines:
set syntax on
set foldmethod=syntax
When you open a large C file, completion (and even general editing) becomes very slow.
Edit:
This behavior was due to the fact that I was using a beta version. I am not sure if I should delete this question altogether, or leave it so if others have the same problem can have some clue about it.
I’m guessing your completion is being adjusted by the syntax highlighting file. To see if this is the case, and make completion lean and fast regardless, try
which will make completion only use the current file.
read more about the complete options with