This didn't get much love on stackoverflow (https://stackoverflow.com/q/48269793/2512141), but I think it's important so I'm reposting here. I think this could be a major barrier to people using Vim's buffers as they're intended, and consequently they resort to tabs to get the file-switching capability they need. Text from the original post follows.
Vim's Netrw file explorer has the following bug: Running the command :e. will open Netrw, but after Netrw closes there is a latent buffer in Vim's buffer list which cannot be traversed with command :bprev. (:bnext works fine.)
This bug is discussed in the following places:
https://www.bountysource.com/issues/45921122-previous-doesn-t-work-with-e-buffer
https://groups.google.com/forum/#!topic/vim_use/zzeQItJQNZI
To replicate this bug, start Vim and run the following commands:
:ls!
:edit ./file1.txt | ls!
:edit ./file2.txt | ls!
:e. #(choose file3.txt in Netrw)
:edit ./file4.txt | ls!
:ls!
At this point, you will see buffers for the files you have opened as well as some buffers with paths, and a buffer with [No Name]. Try to navigate these buffers with
:bnext | ls!
:bprev | ls!
You will find that :bnext successfully loops over the buffers, but :bprev hangs on the Netrw buffer. Is there a workaround for this bug so that buffer navigation with :bnext and :bprev still works?
[No Name]
. After the lastls!
on the first code block I have buffers 1,2,4,5, and 6; 4 is~/path
. I can tell you the difference is thehidden
option. I know it's popular but consider removing it until know the full consequence of the option. Additionally, if you do:bwipe
manually you can get rid of the buffer. Possibly you could set up anautocmd
to do this for you.