Search code examples
vimvi

How to delete a buffer in Vim without closing the window?


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.


Solution

  • I usually use :bn (next buffer) followed by :bd# (delete alternate buffer). You could create a mapping or command for this, of course.