Vim 7: Turning completion on

Omni completion isn't automatically turned on for Vim 7, and it's super useful if you code in CSS or HTML.

In your vimrc you can add following to turn completion on:

autocmd FileType python set omnifunc=pythoncomplete#Complete
autocmd FileType javascript set omnifunc=javascriptcomplete#CompleteJS
autocmd FileType html set omnifunc=htmlcomplete#CompleteTags
autocmd FileType css set omnifunc=csscomplete#CompleteCSS
autocmd FileType xml set omnifunc=xmlcomplete#CompleteTags
autocmd FileType php set omnifunc=phpcomplete#CompletePHP
autocmd FileType c set omnifunc=ccomplete#Complete

You complete things with CTRL-X O.

CSS completion in action:

CSS completion off

Code · VIM Editor 26. Oct 2006
© Amir Salihefendic. Powered by Skeletonz.