2008年7月9日 星期三

auto-complete for vim




auto-complete 是一般IDE 上面常有的功能
但是vim+ctags+omnicppcomplete就可以擁有auto-complete的開發環境
感覺上比visual studio上面提供的還要好用


omnicppcomplete can be downloaded here



install details
1) Unzip the plugin to ~/.vim (unix) or %HOMEPATH%\vimfiles
(windows)
2) Run Vim and type the following command :


:helptags $HOME/.vim/doc or :helptags $HOME/vimfiles/doc
3) Type :h omnicppcomplete and please read the installation
paragraph



做完vim底下的設定之後可以製作自己的tags檔


ctags -R --c++-kinds=+p --language-force=c++ --fields=+iaS --extra=+q
/usr/include
註:tags file will be named as "tags" and located in your current position


在使用omnicppcomplete之前需要在command mode底下載入剛剛製作的tag file


set tags=/usr/include/tags,./tags
註:your tags file position might be different
最後,只要按^x^o就可以使用超強的auto-complete嚕!!


沒有留言: