$ cd ~/.vim/tags $ ctags -R --c++-kinds=+p --fields=+iaS --extra=+q --language-force=C++ cpp_src $ mv tags cpp
ctags -R --c++-kinds=+p --fields=+iaS --extra=+q --language-force=C++ /usr/include/GL mv tags gl
" configure tags - add additional tags here or comment out not-used ones set tags+=~/.vim/tags/cpp set tags+=~/.vim/tags/gl set tags+=~/.vim/tags/fl " build tags of your own project with CTRL+F12 map <C-F12> :!ctags -R --c++-kinds=+p --fields=+iaS --extra=+q .<CR>
" OmniCppComplete let OmniCpp_NamespaceSearch = 1 let OmniCpp_GlobalScopeSearch = 1 let OmniCpp_ShowAccess = 1 let OmniCpp_ShowPrototypeInAbbr = 1 " show function parameters let OmniCpp_MayCompleteDot = 1 " autocomplete after . let OmniCpp_MayCompleteArrow = 1 " autocomplete after -> let OmniCpp_MayCompleteScope = 1 " autocomplete after :: let OmniCpp_DefaultNamespaces = ["std", "_GLIBCXX_STD"] " automatically open and close the popup menu / preview window au CursorMovedI,InsertLeave * if pumvisible() == 0|silent! pclose|endif set completeopt=menuone,menu,longest,preview
" mapping inoremap <expr> <CR> pumvisible()?"\<C-Y>":"\<CR>" inoremap <expr> <C-J> pumvisible()?"\<PageDown>\<C-N>\<C-P>":"\<C-X><C-O>" inoremap <expr> <C-K> pumvisible()?"\<PageUp>\<C-P>\<C-N>":"\<C-K>" inoremap <expr> <C-U> pumvisible()?"\<C-E>":"\<C-U>"
原文:http://www.cnblogs.com/CrossroadsBlackCat/p/3703665.html