Skip to content

Instantly share code, notes, and snippets.

@d4em0n
Created August 2, 2018 16:04
Show Gist options
  • Save d4em0n/f5900d8fe329d8ea30aa28c12c8d4457 to your computer and use it in GitHub Desktop.
Save d4em0n/f5900d8fe329d8ea30aa28c12c8d4457 to your computer and use it in GitHub Desktop.
Jump to tag function/definition into existing tab.
command SelectTag call SelectTag()
nnoremap <silent> <leader>p :SelectTag<CR>
function SelectTag()
let tagident = expand("<cword>")
let curname = expand('%:p')
exe "stjump ".tagident
let newname = expand('%:p')
if curname != newname
exe "norm q"
exe "tab drop ".newname
exe "tag ".tagident
endif
endfunction
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment