> On Tue, Oct 18, 2011 at 10:07:04AM -0700, Richard Catlin wrote:
>I am new to Vim.  I have always programmed in Thicker IDEs, such a
>Eclipse and SlickEdit.  These editors automatically setup
>autocompletion for C++.  What is the best way to do this in Vim?  I am
>on Snow Leopard.


My .vimrc:
" Filetype Detection
" {
    "filetype on
    "filetype plugin on
    "filetype indent on
    filetype plugin indent on "Turns all the above features on ;-)
" }

" Auto Completion (Ctrl-x Ctrl-o)
" {
    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
" }

Ctrl+X + Ctrl+O performs omni-completion the lookup.  (:help completion for 
details.)


Install excuberant ctags:
Package name: ctags
http://ctags.sourceforge.net


Also, checkout the excellent vim plugin(s) by Fritz:

cvim - c/c++ vim plugin
http://www.vim.org/scripts/script.php?script_id=213


A good book, instead of reading VIM's help file, is "Learning the vi and Vim 
Editors 7th Edition".  It'll explain the vimrc settings I posted above in 
detail.

-- 
Roger
http://rogerx.freeshell.org/

-- 
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Reply via email to