PDA

View Full Version : Vim + omnicppcomplete + ctags [Solved]



kroenecker
10th October 2009, 05:26
I just got smart and put this on the wiki:

http://wiki.qtcentre.org/index.php?title=Vim

-- Getting nice autocompletion for QT classes in VIM

This actually is a note to self post and hopefully it will help others.

I use vim. I love it. I used Emacs for a couple years but my pinky finger wanted to fall off and that is when I switched to vim.

- Install ctags (sudo apt-get install ctags)
- Get the latest omnicppcomplete http://www.vim.org/scripts/script.php?script_id=1520
- Install QT



cd ~
mkdir .vim
cd .vim
cp ~/Desktop/omni*.zip .
unzip omni*.zip
vim ~/.vimrc

While editing .vimrc:
-----------------------
syntax enable
filetype on
filetype plugin on
set nocp
set tags +=~/qtsdk-2009.03/qt/include/tags
-----------------------

cd qtsdk-2009.03/qt/include/
ctags -R --c++-kinds=+p --fields=+iaS --extra=+q -I Q_REQUIRED_RESULT


So this assumes that you have the qt sdk installed in your home directory. Make sure that the tags file generated by the ctags command is pointed to correctly in the .vimrc file.

There is quite a bit more that you can do here and I'm sure I will come back to edit this later as my setup evolves.