I usually type :bd
to remove the buffer, however, it results in undesirable side-effect of the window being closed which I do NOT want.
Just use :h enew together with :bd # to delete the last buffer afterwards.
If you want to close the windows split, use :close . The :quit command will work, too, but has the side effect of closing Vim when this is the last window. If you know how Vim deals with buffers, this is a recommended option that many users have set.
^Wc (or :close[!] ) closes the current window. If the hidden option is set and this is the last window referencing this file, Vim closes the window and the buffer is hidden. If this window is on a tab page and is the last window for that tab page, the window and the tab page are closed.
I usually use :bn
(next buffer) followed by :bd#
(delete alternate buffer). You could create a mapping or command for this, of course.
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