Vim/Completion

From Debuntu

< Vim
Jump to: navigation, search

In Vim 7, turning completion on can be done by adding this to ~/.vimrc :

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

Once you open a file with an extension that let vim guess what programming language is used, you can start typing a function name and use: Ctrl-X-Ctrl-O to get the omni-completion working.

Here a link that give more info on using this feature: http://dailyvim.blogspot.com/2009/03/out-of-box-autocompletion.html

Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox
Google AdSense