在(G)Vim中的新选项卡中打开(c)标签

时间:2009-05-25 22:31:20

标签: vim

Ctrl + w Ctrl + i和:stj很不错,但如何在GVim / Vim的新标签页中跳转到标签(光标下)?

3 个答案:

答案 0 :(得分:28)

类似问题How to use multiple tabs when tagging to a function in Vim

它指出了this wikiwhich points back at stackoverflow)这些设置(似乎在终端上运行正常,还没试过gvim):

"--------------------
" Function: Open tag under cursor in new tab
" Source:   https://stackoverflow.com/questions/563616/vimctags-tips-and-tricks
"--------------------
map <C-\> :tab split<CR>:exec("tag ".expand("<cword>"))<CR>
"--------------------
" Function: Remap keys to make it more similar to firefox tab functionality
" Purpose:  Because I am familiar with firefox tab functionality
"--------------------
map     <C-T>       :tabnew<CR>
map     <C-N>       :!gvim &<CR><CR>
map     <C-W>       :confirm bdelete<CR>

答案 1 :(得分:1)

您也可以使用:ptag在预览C-w}中打开标签

答案 2 :(得分:0)

您可以轻松跳转到新标签中的标记

<c-w>gf open in a new tab (Ctrl-w gf)

此外,您可以在拆分视图中打开它:

<c-w>f  open in a new window (Ctrl-w f)

检查一下 - http://vim.wikia.com/wiki/Open_file_under_cursor