0

OmniCppComplete を Vim にインストールしようとしましたが、次のチュートリアルに従いました: http://en.kioskea.net/faq/2367-the-autocompletion-cc-in-vim

プラグインは、root である場合にのみ機能することに気付きました。このプラグインをすべてのユーザーが利用できるようにする方法を教えてください。

.Vimrc: (チュートリアルから)

set nocp      
filetype plugin on      

set tags+=~/.vim/tags/stl      
set tags+=~/.vim/tags/gl      
set tags+=~/.vim/tags/sdl      
set tags+=~/.vim/tags/qt4      


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>      

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"]      

au CursorMovedI,InsertLeave * if pumvisible() == 0|silent! pclose|endif      
set completeopt=menuone,menu,longest,preview

すべてのヒントと答えをとても嬉しく思います!ご挨拶、

4

1 に答える 1

0

I found the solution (according to comment from romainl, thanks!). I have repeated the same process for non-root user.

I needed to modified my .vimrc a bit:

syntax on
filetype plugin on

set tags+=/home/USER_NAME/.vim/tags/stl/tags
set tags+=/home/USER_NAME/.vim/tags/gl/tags
set tags+=/home/USER_NAME/.vim/tags/sdl/tags

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>

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"]

au CursorMovedI,InsertLeave * if pumvisible() == 0|silent! pclose|endif
set completeopt=menuone,menu,longest,preview

First, I have repleaced

set tags+=~/.vim/tags/stl

with:

set tags+=/home/USER_NAME/.vim/tags/stl

Second, I needed to pointed "tags" file directly, so:

set tags+=/home/USER_NAME/.vim/tags/stl/tags

Other ways, It provides OmniCpp pattern not found. More info for example here: vim omnicppcomplete pattern not found

I hope it will be helpful for the others:) Greetings and thanks for help. Now it works fine for non-root user as well.

于 2012-10-07T14:08:28.593 に答える