Vim has some powerful autocompletion features. Out of the box autocompletion for insert mode is a sub mode which you access using Ctrl X. If you view the help file:
:help ins-completion
You can find out all you need to know about the default Vim autocomplete functionality.
Autocompletion can draw it’s matches from many different sources. Below is a list ( taken from the help file ), which I am going to explore a bit.
On Mac OSX Lion, the dictionary files are located at
/usr/share/dict/words
so, in your vimrc
:set dictionary='/usr/share/dict/words'
Now you have autocompletion with 235886 words at your disposal! You can actually give ‘dictionary’ a list, for example you could also add the propernames file at /usr/share/dict/propernames.
Unfortunately, the thesaurus on a Mac is stored in a binary format, so is inaccessible to Vim. Instead, check out https://github.com/sgur/thesaurus-gutenberg.vim, it’s a pre-defined thesaurus for Vim.
** Update: not sure if this plugin works **
This option lets you include words from other files in the include path, if you use ctags, this is almost not necessary in my mind.
Vim’s autocomplete can use the tags file generated by ctags to give you a match, this is very useful if you want to use class, method or varibale names accross classes.
Not really sure how this works
This is really just for when you are writing vimscript and want to autocomplete some Vim command, it doesn’t work in Visual Mode or Command line mode.
This function looks like it could be really powerful as it lets you define your own custom function for autocompletion. Perhaps the topic of another post :)
My personal favorite, as recommended by a colleague: https://github.com/ervandew/supertab
Also: https://github.com/Shougo/neocomplcache
http://vim.wikia.com/wiki/Any_word_completion