By default, VIM :e
command will create a new buffer with specified file, leaving current buffer to hand around. This leads to buffers count growing very large (and that is not handy if some buffer display plugin is used, for example popular minibufexplorer
). Is it possible to modify VIM so :e
command will re-use current buffer? If i need two buffers, i can always create second one via :enew
command, after all.
Pressing Alt-F12 opens a window listing the buffers, and you can press Enter on a buffer name to go to that buffer. Or, press F12 (next) or Shift-F12 (previous) to cycle through the buffers.
To open the next buffer in the buffer list in a new window, use the ":sbnext" command. To edit the previous buffer in the buffer list, use the ":bprevious" or ":bNext" command. or the abbreviated ":bp" To open the previous buffer in the buffer list in a new window, use the ":sbprevious" or ":sbNext" command.
:e thefile | bd#
This solution has the advantage that it will preserve windows.
#
is the alternate buffer)If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With