[vim] add mapping for opening tab in a new Tab change mapping for tag gen
This commit is contained in:
parent
4aed928574
commit
2435bc4b0a
20
.vimrc
20
.vimrc
@ -11,8 +11,8 @@
|
|||||||
" F8 view tag list
|
" F8 view tag list
|
||||||
" S-F8 build ctags/cscope databases
|
" S-F8 build ctags/cscope databases
|
||||||
" M-F8 build kernel ctags/cscope databases
|
" M-F8 build kernel ctags/cscope databases
|
||||||
" F9 build cscope in .vim/cscope
|
" S-F9 build cscope in .vim/cscope
|
||||||
" S-F9 Search cscopeDB in .vim/cscope
|
" F9 Search cscopeDB in .vim/cscope
|
||||||
" M-F9 diff tool
|
" M-F9 diff tool
|
||||||
" F10 folding
|
" F10 folding
|
||||||
" F11 unhighlight search
|
" F11 unhighlight search
|
||||||
@ -218,8 +218,8 @@ else
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
if has("cscope")
|
if has("cscope")
|
||||||
map <S-F9> :call GetCscopeDb(expand("%:p:h")) <CR><CR>
|
map <F9> :call GetCscopeDb(expand("%:p:h")) <CR><CR>
|
||||||
map <F9> :call GenerateCscopeDb() <CR><CR>
|
map <S-F9> :call GenerateCscopeDb() <CR><CR>
|
||||||
endif
|
endif
|
||||||
" close preview window after a completion
|
" close preview window after a completion
|
||||||
if has("autocmd")
|
if has("autocmd")
|
||||||
@ -227,6 +227,18 @@ if has("autocmd")
|
|||||||
autocmd InsertLeave *.{[hc],cpp} if pumvisible() == 0|pclose|endif
|
autocmd InsertLeave *.{[hc],cpp} if pumvisible() == 0|pclose|endif
|
||||||
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 "
|
" PASTE "
|
||||||
"""""""""
|
"""""""""
|
||||||
|
Loading…
Reference in New Issue
Block a user