I often use :tab sball to open all buffers as tabs, but sometimes after doing so I would like to close the tab and remove file from buffers at the same time. How can I achieve that?

I know already that if I open a new tab with
:tabe and don't save it- it close it with buffer using: q!.

Is there something similar to close tab and buffer at the same time?

I'm using neovim (NVIM 0.1.3-dev).

1 Answer 1


:bd will do that.

From the documentation:

:[N]bd[elete][!]            *:bd* *:bdel* *:bdelete* *E516*
:bd[elete][!] [N]
        Unload buffer [N] (default: current buffer) and delete it from
        the buffer list.  If the buffer was changed, this fails,
        unless when [!] is specified, in which case changes are lost.
        The file remains unaffected.  Any windows for this buffer are
        closed.  If buffer [N] is the current buffer, another buffer
        will be displayed instead.  This is the most recent entry in
        the jump list that points into a loaded buffer.
        Actually, the buffer isn't completely deleted, it is removed
        from the buffer list |unlisted-buffer| and option values,
        variables and mappings/abbreviations for the buffer are
  • Thanks. I'm sorry- I don't know how I could have missed that...
    – lewiatan
    Commented Mar 10, 2016 at 10:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.