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 with :bd *.xml
. However, Vim does not allow this (E93: More than one match...).
Is there any way to do this?
P.S. I know that :bd file1 file2 file3
works. So can I somehow evaluate *.xml
to file1.xml file2.xml file3.xml
?
Assuming the default backslash leader key, you can also press \bd to close (delete) the buffer in the current window (same as :Bclose ).
Permanently deleting your Buffer accountClick on your profile avatar at the top right of your dashboard and then click Account from the drop down menu. Click Delete My Buffer Account towards the bottom of the page. Enter your password and click Confirm.
To delete all line you can use either the % symbol that represents all lines or the 1,$ range: Press the Esc key to go to normal mode. Type %d and hit Enter to delete all the lines.
You can use <C-a>
to complete all matches. So if you type :bd *.xml
and then hit <C-a>
, vim will complete the command to :bd file1.xml file2.xml file3.xml
.
:3,5bd[elete]
Will delete buffer range from 3 to 5 .
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With