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,731 times
4
stdcerr
- 253
- 4
- 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
- 23,415
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
- 1,131
- 12
- 14