How do I close a window or unsplit without deleting the buffer?
Vim windows are closed using :q
.
However, if you don't have another window open, it will exit from Vim. If you do have another window to switch to, only the current window is closed, and buffer remains open. You may need to set hidden
.
To close a buffer, you would need to do :bdelete
.
You can check if your buffer is open or not by using :buffers
.