let’s say currently there are two buffers in my vim session, and I want to close the current buffer which is under edit in order to switch the other buffer and edit it . using
:q
will quit the whole vim rather than a buffer . so my question is are there any commands can close the current buffer under editing and automatically switch to the next buffer in the buffer list .
Just doing a
should do it.
Edit: You can delete specific buffers as well using this command.
Get a list of your current buffers by entering:
This will give you something like:
Take the relevant number and enter it before the bd command, so entering
will delete the second buffer.