日期:2014-05-16 浏览次数:20796 次
syntax enable set tabstop=4 set backspace=2 set expandtab set linebreak set incsearch set gdefault set laststatus=2 set ruler "programe related setting filetype plugin indent on set completeopt=longest,menu syn on set showmatch set smartindent set shiftwidth=4 set autoindent set ai! "ctags related setting "set tags=tags,tagsx set tags=tags set tags+=~/.vim/systags "Taglist related setting let Tlist_Exit_OnlyWindow=1 let Tlist_GainFocus_On_ToggleOpen=1 let Tlist_Close_On_Select=1 let Tlist_File_Fold_Auto_Close=1 "nmap <F8> :TlistTogg<cr> nmap <F1> :Tlist<cr> "nmap <F2> :TlistOpen<cr> "winmanage related setting "let g:winManagerWindowLayout='FileExplorer|TagList' let g:winManagerWindowLayout='FileExplorer' let g:winManagerWidth=35 let g:defaultExplorer=0 nmap <F2> :WMToggle<cr> "cscope related setting if has("cscope") set csprg=/usr/bin/cscope set cscopequickfix=s-,c-,d-,i-,t-,e- set csto=0 set cst set nocsverb " add any database in current directory if filereadable("cscope.out") cs add cscope.out " else add database pointed to by environment elseif $CSCOPE_DB != "" cs add $CSCOPE_DB endif set csverb endif nmap <F4>s :cs find s <C-R>=expand("<cword>")<CR><CR> nmap <F4>g :cs find g <C-R>=expand("<cword>")<CR><CR> nmap <F4>c :cs find c <C-R>=expand("<cword>")<CR><CR> nmap <F4>t :cs find t <C-R>=expand("<cword>")<CR><CR> nmap <F4>e :cs find e <C-R>=expand("<cword>")<CR><CR> nmap <F4>f :cs find f <C-R>=expand("<cfile>")<CR><CR> nmap <F4>i :cs find i ^<C-R>=expand("<cfile>")<CR>$<CR> nmap <F4>d :cs find d <C-R>=expand("<cword>")<CR><CR> "minibufer related setting let g:miniBufExplMapWindowNavVim = 1 "grep related setting nnoremap <silent> <F3> :Grep<CR>
------解决方案--------------------
ctags -R --c-kinds=+p --fields=+S /path
我是用上面这个命令生成系统跟标准库函数的tags,然后放到~/.vim目录下,然后codecomeplete插件使用这些tags
------解决方案--------------------
自从Vim发布7.0之后, 就开始支持标签或者叫标签页 :tabnew file :tabp :tabn
ctags+taglist+omni-completion
在src或者下ctags -R就行了
标准库的 /usr/include下 ctags -R 然后把tags挎贝到源目录下
或者在vimrc中加上set tags+=/usr/include/tags