I have my vim setup according to "Solution #1: Replicating Tabs with Buffers" on this site buffers-vs-tabs with the vim-airline plugin.
If I open numerous files in buffer 'tabs' :bprevious
/:bnext
just cycles through them great (and wrap when you get to the end of the 'tabs').
However, as soon as I attempt to use netrw by calling vim on a directory all of the sudden things start misbehaving.
For example, if I execute vim on a directory (vim .
) and use netrw to drill down a directory hierarchy and hit Enter to open a file, it opens in a new buffer 'tab'. If I do :bprevious
, it goes back to the netrw explorer. If I open another file with the explorer, it opens yet another buffer 'tab' to the right of the first file. :bprevious
brings me back to netrw, not the file buffer to the left of the of the most recently opened file. Also when getting back to the file explorer, if I do another :bprevious
, the cursor just jumps to the top of the netrw window and then doesn't move again with repeated :bprevious
. Note that during this scenario the netrw is showing up as a buffer 'tab' in the tabline but not highlighted like files. Also note that the NetrwTreeListing 'count' on the bottom keeps incrementing.
Alternatively, if I execute vim without a directory and just use ctrlp to open some files and then use :Ex
, A) it does not create a buffer 'tab', it simply displays a buffer/window with the netrw listing and I can open another file and it pops up as the leftmost buffer tab and :b(previous|next)
works fine.
In either case :ls!
shows a ton of NetrwTreeListing buffers.
I removed vim-vinegar to make sure it was not due to that and there wasn't really any change but the '-' feature of vim-vinegar does expose this issue as well.
Note: I apologize for poor terminology with regards to tabs/buffers/windows, but hopefully my explanation makes sense.
EDIT: Things get slightly better if I remove this from my .vimrc:
let g:netrw_liststyle=3
Sometimes I still get 'stuck' at the file explorer and :bprevious
stays still.