[zsh] tags + vimlatex

This commit is contained in:
Mathieu Maret 2011-01-27 00:06:07 +01:00
parent beabe7e08f
commit 932a4353a7
1 changed files with 30 additions and 8 deletions

38
.vimrc
View File

@ -280,8 +280,10 @@ if has("cscope")
if filereadable("cscope.out") if filereadable("cscope.out")
cscope add cscope.out cscope add cscope.out
endif endif
" add the database pointed by environment variable " add the database pointed by environment variable.
if $CSCOPE_DB != "" " Cscope file added from db should contains full path to file. Otherwise they
" should be added with cscope add PATH_TO_CSCOPE_FILE PATH_TO_SRC_ROOT
if $CSCOPE_DB != ""
if filereadable($CSCOPE_DB) if filereadable($CSCOPE_DB)
cscope add $CSCOPE_DB cscope add $CSCOPE_DB
endif endif
@ -330,7 +332,7 @@ if has("cscope")
nmap <C-@><C-@>d :vertical scscope find d <C-R>=expand("<cword>")<CR><CR> nmap <C-@><C-@>d :vertical scscope find d <C-R>=expand("<cword>")<CR><CR>
" s symbol find all references to the token under cursor " s symbol find all references to the token under cursor
" //find this C symbol " //find this C symbol
" g global find global definition of the token under cursori " g global find global definition of the token under cursor
" //find this definition " //find this definition
" c calls find all calls to the function name under cursor " c calls find all calls to the function name under cursor
" //find function calling this function " //find function calling this function
@ -348,9 +350,15 @@ endif
" cat Makefile | grep '\-I\/' | tr '[:space:]' '\n' | grep '\-I/' | sort -u | tr '\n' ' ' " cat Makefile | grep '\-I\/' | tr '[:space:]' '\n' | grep '\-I/' | sort -u | tr '\n' ' '
" build tags database with shift+F8 or alt+F8 to ignore /usr/include " build tags database with shift+F8 or alt+F8 to ignore /usr/include
" --c++-kinds=+p : Adds prototypes in the database for C/C++ files.
" --fields=+iaS : Adds inheritance (i), access (a) and function
" signatures (S) information.
" --extra=+q : Adds context to the tag name. Note: Without this
" option, the script cannot get class members.
command! CtagsBuild command! CtagsBuild
\ :!echo 'building ctags database...' ; \ :!echo 'building ctags database...' ;
\ ctags --fields=+iaS --extra=+q --totals -R && \ ctags --fields=+iaS --extra=+q --totals -R --c++-kinds=+p &&
\ echo 'adding system headers...' ; \ echo 'adding system headers...' ;
\ find -exec gcc -M '{}' \; 2>&- | tr '[:space:]' '\n' | grep '^/.*' | sort -u | \ find -exec gcc -M '{}' \; 2>&- | tr '[:space:]' '\n' | grep '^/.*' | sort -u |
\ ctags --c-kinds=+px --c++-kinds=+px --fields=+iaS --extra=+q -aL- \ ctags --c-kinds=+px --c++-kinds=+px --fields=+iaS --extra=+q -aL-
@ -364,8 +372,8 @@ command! CscopeKernelBuild
\ :!echo 'building cscope database in kernel mode...' ; \ :!echo 'building cscope database in kernel mode...' ;
\ cscope -bkR \ cscope -bkR
if has("cscope") if has("cscope")
map <S-F8> :CtagsBuild<CR><CR>:CscopeBuild<CR><CR>:cscope reset<CR><CR> map <S-F8> :CtagsBuild<CR><CR>:CscopeBuild<CR><CR>:cscope reset<CR><CR>:cscope add cscope.out<CR><CR>
map <M-F8> :CtagsKernelBuild<CR><CR>:CscopeKernelBuild<CR><CR>:cscope reset<CR><CR> map <M-F8> :CtagsKernelBuild<CR><CR>:CscopeKernelBuild<CR><CR>:cscope reset<CR><CR>:cscope add cscope.out<CR><CR>
else else
map <S-F8> :CtagsBuild<CR><CR> map <S-F8> :CtagsBuild<CR><CR>
map <M-F8> :CtagsKernelBuild<CR><CR> map <M-F8> :CtagsKernelBuild<CR><CR>
@ -510,13 +518,15 @@ let OmniCpp_MayCompleteDot = 1 " autocomplete after .
let OmniCpp_MayCompleteArrow = 1 " autocomplete after -> let OmniCpp_MayCompleteArrow = 1 " autocomplete after ->
let OmniCpp_MayCompleteScope = 1 " autocomplete after :: let OmniCpp_MayCompleteScope = 1 " autocomplete after ::
set path=.,..,/usr/local/include,/usr/include set path=.,..,/usr/local/include,/usr/include
" :set tags+=~/.vim/wxwidgetstags
set tags=tags
set tags=./tags " in file directory
set tags+=tags " in current directory
"for when programming in build dir "for when programming in build dir
set tags+=../tags set tags+=../tags
set tags+=~/.vim/qttags set tags+=~/.vim/qttags
set tags+=~/.vim/qtembedded set tags+=~/.vim/qtembedded
set tags+=~/.vim/tags/linux-sh4-ST-2.6.23.17
" Affichage du prototype d'une fonction sur le " Affichage du prototype d'une fonction sur le
" plugin echofunc " plugin echofunc
@ -631,3 +641,15 @@ nnoremap <silent> <Leader>t :call Translate()<cr>
" trad files should be under /usr/share/vim/vimfiles/spell " trad files should be under /usr/share/vim/vimfiles/spell
set spell spelllang=en set spell spelllang=en
set nospell set nospell
"""""""""""""
" Latex "
"""""""""""""
" package vim-latexsuite
" Insert the following line in your ~/.vim/ftplugin/tex.vim file:
" imap <buffer> <leader>it <Plug>Tex_InsertItemOnThisLine
" compile with \ll
set grepprg=grep\ -nH\ $*
let g:tex_flavor = "pdflatex"
imap <buffer> <leader>it <Plug>Tex_InsertItemOnThisLine
let g:Tex_DefaultTargetFormat="pdf"