vim `ag -lQ TERM`
The following takes an existing quickfix list (for example, from
:Ack TERM), applies the replacement, and saves them.
cdoruns the command for each entry in the quickfix list while
cfdorunes the command for each file in the quickfix list.
The following command takes a list of files including
TERM, applies the replacement, and saves them.
vim `ag -lQ TERM` +"argdo %s/TERM/REPLACEMENT/g | update"
The following allows adding all files matching a glob to the arglist, where you can then operate on them. This example uses
:execand string concatenation to open all files matching the extension
.tsxin the parent directory of the current file.
:exec 'args ' . expand('%:h') . '/**.tsx'