如题,网上有很多关于怎么把 vim打造成C/C++
IDE的,我按照他们说的做了,下载omnicppcomplete,解压后放在vim对应的文件下(我放的是/usr/share/vim
/vimfiles对应的 文件夹下),之后在/usr/include文件下运行命令: ctags -R
并修改vim的配置文件vimrc的末尾加上:" configure tags - add additional tags here or comment out not-used ones
set tags+=/usr/include/tags
set tags+=./tags
" 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
保存后并退出
测试的时候输入 std:: ,提示O^N^P找不到匹配模式
求大神帮忙解决。。。
并修改vim的配置文件vimrc的末尾加上:" configure tags - add additional tags here or comment out not-used ones
set tags+=/usr/include/tags
set tags+=./tags
" 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
保存后并退出
测试的时候输入 std:: ,提示O^N^P找不到匹配模式
求大神帮忙解决。。。