Question

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 {}

Was it helpful?

Solution

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top