I'm using a combination of buffers and splits. What I want is for :bnext
or :bprev
(or some equivalent) not to open buffers that are already opened in some other split or tab.
Is this possible?
Vi and Vim Stack Exchange is a question and answer site for people using the vi and Vim families of text editors. It only takes a minute to sign up.
Sign up to join this communityI'm using a combination of buffers and splits. What I want is for :bnext
or :bprev
(or some equivalent) not to open buffers that are already opened in some other split or tab.
Is this possible?
As an alternative, stop using :bnext
/ :bprev
for navigation.
"Why ride a bike when you can fly?"
Just open the buffer you want where you want to open it (and how).
:b
!:<tab>
completion<c-d>
to list out completion:b foo
. Works great with <tab>
.:b foo*bar
or :b foo/**/bar
:b
is :sb
.nnoremap <leader>b :ls<cr>:b<space>
Using :b
/ :sb
will allow you to simply open the buffer you want. No more cycling. No more worrying about the buffer list (:set hidden
). This often leads to simpler window layouts, because you do not feel like you need to "store" a buffer in some split because it is tedious to find it again.
set nobuflisted
– Christian Brabandt Nov 16 '17 at 16:04