Assuming I have multiple files opened as buffers in Vim. The files have *.cpp
, *.h
and some are *.xml
. I want to close all the XML files w
Very simply: use the :bd[elete]
command. For example, :bd[elete] buf#1 buf#5 buf#3
will delete the buffers 1, 3, and 5.
TAB
will only autocomplete one file for you as of Vim 7.4.282
use<c-a>
to autocomplete all files.
You can just use:
bd filetype
then just use <c-a>
to facilitate the completion of all open files of specified filetype.
for example, you have 1.xml, 2.xml, 3.xml, and 4.xml, you can do:
bd xml
then press <c-a>
vim will autocomplete for you as follow:
bd 1.xml 2.xml 3.xml 4.xml
you can just press enter to complete the command.
if you have made changes in one of the files mentioned above, do remember to do:
bd! xml