Batch editing
Opening a list of files
Operating on a list of files within vim using cdo
, cfdo
cdo
, cfdo
The following takes an existing quickfix list (for example, from :Ack TERM
), applies the replacement, and saves them.
cdo
runs the command for each entry in the quickfix list while cfdo
runes the command for each file in the quickfix list.
Operating on a list of files using argument list
Batch editing files outside vim using argdo
argdo
The following command takes a list of files including TERM
, applies the replacement, and saves them.
Bulk editing files from within vim
The following allows adding all files matching a glob to the arglist, where you can then operate on them. This example uses :exec
and string concatenation to open all files matching the extension .tsx
in the parent directory of the current file.
Last updated