Quantcast
Viewing latest article 1
Browse Latest Browse All 3

Answer by Stéphane Chazelas for Can a file be closed in vim without exiting?

That would be :bd. :help :bd in vim 8.2 gives:

:[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            cleared. Examples:                :.,$-bdelete    " delete buffers from the current one to" last but one                :%bdelete       " delete all buffers

Viewing latest article 1
Browse Latest Browse All 3

Trending Articles