[vim] add mapping for opening tab in a new Tab change mapping for tag gen

This commit is contained in:
Mathieu Maret 2011-06-09 14:02:03 +02:00
parent 4aed928574
commit 2435bc4b0a
1 changed files with 16 additions and 4 deletions

20
.vimrc
View File

@ -11,8 +11,8 @@
" F8 view tag list
" S-F8 build ctags/cscope databases
" M-F8 build kernel ctags/cscope databases
" F9 build cscope in .vim/cscope
" S-F9 Search cscopeDB in .vim/cscope
" S-F9 build cscope in .vim/cscope
" F9 Search cscopeDB in .vim/cscope
" M-F9 diff tool
" F10 folding
" F11 unhighlight search
@ -218,8 +218,8 @@ else
endif
if has("cscope")
map <S-F9> :call GetCscopeDb(expand("%:p:h")) <CR><CR>
map <F9> :call GenerateCscopeDb() <CR><CR>
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")
@ -227,6 +227,18 @@ if has("autocmd")
autocmd InsertLeave *.{[hc],cpp} if pumvisible() == 0|pclose|endif
endif
function! TagInNewTab()
let word = expand("<cword>")
redir => tagsfiles
silent execute 'set tags'
redir END
tabe
execute 'setlocal' . strpart(tagsfiles, 2)
execute 'tag ' . word
endfunction
nmap <S-Enter> :call TagInNewTab()<CR>
"""""""""
" PASTE "
"""""""""