Ctrl+w Ctrl+i and :stj is nice, but how do I jump to a tag (under the cursor) in a new tab in GVim/Vim?
Opening (c)tags in new tab in (G)Vim
A supercharged superset of this: #539731 : open on new tab only if in another file, and when closing the new tab jump back to the parent. –
Marseillaise
Similar question How to use multiple tabs when tagging to a function in Vim
It points out this wiki (which points back at stackoverflow) with these settings (seems to work ok in terminal, haven't tried gvim):
"--------------------
" Function: Open tag under cursor in new tab
" Source: https://mcmap.net/q/55034/-vim-and-ctags-tips-and-tricks-closed
"--------------------
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>
That first link contained the magical
nmap <C-Enter> <C-w><C-]><C-w>T
which was exactly what I was looking for. Thanks! –
Amnion This is really nice, but it always opens a new tab. What if the file is already opened in another tab? Is there a way to do it? –
Stud
@OlivierPons See my answer on this post to get it to reuse existing tabs: vi.stackexchange.com/questions/10014/… –
Gemination
You can easy jump to tag in a new tab like this
<c-w>gf open in a new tab (Ctrl-w gf)
Also, you can open it in a split view:
<c-w>f open in a new window (Ctrl-w f)
Check this - http://vim.wikia.com/wiki/Open_file_under_cursor
© 2022 - 2024 — McMap. All rights reserved.