I usually open files one in a single vim application. Occasionally, I open multiple files at once to fix some mistakes in batch, for example, after static analyzer.
If I was edited files in the order b
, c
, a
, and run from a command line vim a b c
, I'll see that my current buffer is b
, previos buffer is c
, but buffers will be opened and assigned their numbers sequentially in the order a
, b
, c
. In other words, the order of numbered buffer list is the same as the order in the command line, but the order in which buffers are actually opened (starting buffer, :bn
and :bp
) is the same as I previously opened individual files, starting from the last one.
I heavily use w | bw
sequence and I rely on what previous/next buffer is. It's become even more annoying when you open 50+ files and you have to read output from an analyzer upside-down or in a random order, because vim
desided to order buffers this way. The command example I use to run a "mass fix session" is vim $(awk -F: '{print $1}' analyzer.out | uniq)
To manually override this behaviour I have to remove .viminfo
file, but from time to time it contains useful information like last used commands which I use a lot.
How to prevent Vim to have this behaviour? Or any command I could run to reset it? When using session management, it's quite fine to restore a file I previously was, but it's quite useless and annoing in my case.
Currently I use MacVim 8.1.280 (151) in GUI mode, but, unfortunately, it's not a MacVim-specific issue and running vim on Linux or FreeBSD have the same behavior.
Different installations share only YCM and I don't believe that it responsible for this odd behavior.
:cnext
?:cnext
command as it coult be quite heavy to run command from Vim itself (e.g. output fromtox
)..viminfo
file