6 ms·
Nice overview of vim's completion features, but... This article is very incomplete, there are various completion modes. I also don't recommend mapping complete
by exDM69 14y ago
Nice overview of vim's completion features, but...
This article is very incomplete, there are various completion modes. I also don't recommend mapping complete to tab (or even using SuperTab or other completion plugins). Vim has a total of 13 different completion modes (see :help ins-completion), all of which are useful. There's complete on local and global keywords, complete for complete lines or filenames.
In particular, this article calls Vim 7's omni complete (^X^O) "syntax aware complete" which it is not. It's a language specific completion, which can complete stuff like members of structs or functions. You need your language specific plugins to be installed. Vim ships with a decent plugin for C and C-like languages, which works if you have a ctags database generated (:help 'tags').
If you want syntax completion, you can map it to user-defined completion (^X^U) like this:
set completefunc=syntaxcomplete#Complete
It's not particularly useful as such, because syntax complete completes keywords like "for" and "while" which we all have in muscle memory.