VIM c++配置

vim for c/c++

1. 假设工程

duotai
├── Makefile
├── apple.cc
├── apple.h
├── fruit.cc
├── fruit.h
└── main.cc

2. cscope

cscope -Rb

duotai
├── Makefile
├── apple.cc
├── apple.h
├── cscope.out
├── fruit.cc
├── fruit.h
└── main.cc

3. ctag

ctags -R --sort=1 --c+±kinds=+p --fields=+iaS --extra=+q --language-force=C++

duotai
├── Makefile
├── apple.cc
├── apple.h
├── cscope.out
├── fruit.cc
├── fruit.h
├── main.cc
└── tags

ctags -R --sort=1 --c+±kinds=+p --fields=+iaS --extra=+q --language-force=C++ -f 指定存储到某个固定路径,
此时 在vimrc中要设置这个路径如下:

·set tags+=tag文件的路径

4. 安装 OmniCppComplete

call vundle#begin()
...

"OmniCppComplete
Plugin 'vim-scripts/OmniCppComplete'

call vundle#end()

let OmniCpp_NamespaceSearch = 1
let OmniCpp_GlobalScopeSearch = 1
let OmniCpp_ShowAccess = 1
let OmniCpp_ShowPrototypeInAbbr = 1
let OmniCpp_MayCompleteDot = 1
let OmniCpp_MayCompleteArrow = 1
let OmniCpp_MayCompleteScope = 1
let OmniCpp_DefaultNamespaces = ["std", "_GLIBCXX_STD"]
au CursorMovedI,InsertLeave * if pumvisible() == 0|silent! pclose|endif
set completeopt=menuone,menu,longest
highlight Pmenu    guibg=darkgrey  guifg=black
highlight PmenuSel guibg=lightgrey guifg=black

你可能感兴趣的:(bash)