[vim] cleaning .vimrc

This commit is contained in:
Mathieu Maret 2013-03-04 17:05:25 +01:00
parent 0fc98a9065
commit 292f741bb1

43
.vimrc
View File

@ -13,7 +13,7 @@
" M-F8 build kernel ctags/cscope databases
" S-F9 build cscope in .vim/cscope
" F9 Search cscopeDB in .vim/cscope
" M-F9 diff tool
" M-F10 diff tool
" F10 folding
" F11 unhighlight search
" F12 paste mode
@ -162,7 +162,6 @@ endif
" SEARCH "
""""""""""
" highlight search
set hlsearch
" unhighlight current search
@ -208,6 +207,8 @@ let Tlist_Display_Tag_Scope = 0
let Tlist_Show_One_File = 1
let Tlist_Compact_Format = 1
let Tlist_Enable_Fold_Column = 0
" sort by name or order ?
let Tlist_Sort_Type = "name"
"let Tlist_File_Fold_Auto_Close = 1
let Tlist_Inc_Winwidth = 0
"let Tlist_Use_Horiz_Window = 1
@ -216,41 +217,7 @@ let Tlist_Use_Right_Window = 1
map <silent> <F8> :TlistToggle<CR>
" 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
" --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
\ :!echo 'building ctags database...' ;
\ ctags --fields=+iaS --extra=+q --totals -R --c++-kinds=+p &&
\ echo 'adding system headers...' ;
\ find -exec gcc -M '{}' \; 2>&- | tr '[:space:]' '\n' | grep '^/.*' | sort -u |
\ ctags --c-kinds=+px --c++-kinds=+px --fields=+iaS --extra=+q -aL-
command! CtagsKernelBuild
\ :!echo 'building ctags database in kernel mode...' ;
\ ctags --fields=+iaS --extra=+q --totals -R --c++-kinds=+p
command! CscopeBuild
\ :!echo 'building cscope database...' ;
\ cscope -bR
command! CscopeKernelBuild
\ :!echo 'building cscope database in kernel mode...' ;
\ cscope -bkR
if has("cscope")
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>:cscope add cscope.out<CR><CR>
else
map <S-F8> :CtagsBuild<CR><CR>
map <M-F8> :CtagsKernelBuild<CR><CR>
endif
if has("cscope")
map <F9> :call GetCscopeDb(expand("%:p:h")) <CR><CR>
map <S-F9> :call GenerateCscopeDb() <CR><CR>
endif
" close preview window after a completion
if has("autocmd")
autocmd CursorMovedI *.{[hc],cpp} if pumvisible() == 0|pclose|endif
@ -351,8 +318,8 @@ imap <M-S-F1> <Esc><M-S-F1>
" show current changes with F9
command! DiffOrig
\ vert new | set bt=nofile | r # | 0d_ | diffthis | wincmd p | diffthis
map <M-F9> :DiffOrig<CR>
imap <M-F9> <ESC><M-F9>a
map <M-F10> :DiffOrig<CR>
imap <M-F10> <ESC><M-F10>a
" show git diff when committing
let g:git_diff_spawn_mode = 1
if has("autocmd")