vim omnicppcomplete pattern not found

泪湿孤枕 提交于 2019-12-30 11:00:36

问题


I installed vim7.3 on my computer (under windows 7) and i want to use an autocomplete plugin.

I searched a lot and found that Omnicppcomplete is the best for that.

So i followed this tutorial: Install OmniCppComplete plugin

My _vimrc config file looks like this:

set nocp 
filetype plugin on
syntax on
set filetype=cpp

set tags+=C:/Program\ Files/Vim/vimfiles/tags/stl

" build tags of your own project with CTRL+F12 
"map <C-F12> :!ctags -R --c++-kinds=+p --fields=+iaS --extra=+q .<CR> 
noremap <F12> :!ctags -R --c++-kinds=+p --fields=+iaS --extra=+q .<cr> 
inoremap <F12> <Esc>:!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_MayCompleteDot = 1 
let OmniCpp_MayCompleteArrow = 1 
let OmniCpp_MayCompleteScope = 1 
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

But if i type this an error occurs and dont know why.

#include <iostream>

int main(void) {
   std::|
}

and the error: -- Omni completion (^O^N^P) Pattern not found

and this bugfix not helps because i already use files which uses namespace std {}


回答1:


the problem was that the set tags+=C:/Program\ Files/Vim/vimfiles/tags/stl there is something wrong here:

  • :pwd -> c:\Windows\system32
  • copy the tags file to system32
  • restart vim

then the following c++ code worked.



来源:https://stackoverflow.com/questions/5313943/vim-omnicppcomplete-pattern-not-found

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!