New answers tagged file
2
One way is to populate the quickfix list with matches then use :cfdo to execute :bdelete
:vimgrep /pat/ ##
:cfdo bdelete
Even though the files are closed the files are still in the argument-list. Remove them via :argdelete with % to represent the current file
:vimgrep /pat/ ##
:cfdo bdelete | argdelete %
For more help see:
:h :vimgrep
:h :grep
:h :cfdo
:h :...
Top 50 recent answers are included
Related Tags
file × 12save × 3
vimscript × 1
regular-expression × 1
autocompletion × 1
netrw × 1
vimscript-python × 1
find × 1
counting × 1
grep × 1
open × 1
ascii × 1