With vim only
There's a few options to make navigation between files less tedious in vanilla vim.
First, you probably want to have
set switchbuf=useopen in your vimrc (
:h 'switchbuf') to reuse a split, instead of opening the buffer in the current split.
If you have the buffer number in
%n), you can then easily switch to a split by number with
This will also work if you give a unique pattern from the name. If you are in the split 'foo' and have two more splits 'bar' and 'baz',
:sbuffer az will switch to the 'baz' split.
You can have a mapping to make it easier:
nnoremap <leader>b :sbuffer (there's a space at the end).
Also, those mappings help switch to different splits (
<c-w>t -> top left split
<c-w>b -> bottom right split
<c-w>p -> last used split
Besides, could use fzf.vim plugin (requires fzf) and its
switchbuf=useopen, you'll want
let g:fzf_buffers_jump = 1 in your vimrc to reuse an open split.
The command will show a list of buffers which you can strip down with fuzzy search, and navigate with
<Enter> will then switch to the split if already open, or else use the current one.
<c-t> will open the buffer in a new vertical split, horizontal split or tab.
You could have a mapping to launch
nnoremap <leader>b :Buffers<cr>.