When I move over a key word and then hit ^], it will jump to the definition in thecurrently active split. How can I keep the current split the same and instead open the definition in another split window (either vertical or horizontal)?
Asked
Active
Viewed 3,009 times
4
stdcerr
- 243
- 3
- 12
2 Answers
7
<C-]> doesn't jump to the reference of the word under the cursor, it jumps to its definition.
Anyway, you can use <C-w>] to open the tag in a new window.
See :help window-tag.
romainl
- 22,554
- 2
- 49
- 59
1
You can remap ^] with the following commands:
nnoremap <C-]> :only<bar>vsplit<CR>:execute "tag" . expand('<cword>')<CR>
Put that in your .vimrc and restart vim.
Reference:
alpha_989
- 993
- 10
- 14