- Create macro (let's say we're saving it to 'x')
- View macros in registry
:reg x
- Copy content of macro
"xp
- Store macro to file (file must be loaded by vim on startup. See here
Use "[register letter]p
to paste into a file with the format below
let @x = "<macro contents>"
- Use
find
to generate a list of files that need to be updated iefind . -type f -name "*.yaml"
- Open files with
nvim -u NONE $(<find command>)
- Apply macro to all files
argdo normal @x
- Save all files
Alternatie solution
- Create macro (let's say we're saving it to 'x')
- View macros in registry
:reg x
- Use telescope to fuzzy find the files you need
- Send them to quickfix list
CTRL-q
- Run macro on all the files
:cdo normal @x
Alternatie solution 2
- Create macro (let's say we're saving it to 'x')
- View macros in registry
:reg x
- Use vimgrep to search to build a quickfix list of where to paste the text
:vim /pattern/ dir/*.ext
- Run macro on all the files
:cdo normal @x