How do I apply a recorded macro to a specific set of files using the argument list?
:argdo execute 'normal @q' | update
:argdo runs an Ex command on every file in Vim's argument list (the arglist).
:argdo execute 'normal @q' | update
:argdo runs an Ex command on every file in Vim's argument list (the arglist).
:set lazyredraw
When Vim runs a macro or an :argdo / :bufdo loop, it redraws the screen after every command by default.
:args **/*.py
Vim's argument list (arglist) is a named list of files that you can operate on as a group.
:Rename {newname}
vim-eunuch (by Tim Pope) adds Unix shell operations as first-class Vim commands.
:t.
The :t (short for :copy) command copies lines from one location to another.
:%!{command}
The ! filter command in Vim sends a range of lines to an external program as standard input, then replaces those lines with the program's standard output.
:helpgrep {pattern}
:helpgrep searches the full text of every Vim help file for a pattern and loads all matches into the quickfix list.
:put ={expression}
The :put command inserts the contents of a register as a new line below the cursor.
:let @q = '{keystrokes}'
You can assign a string directly to any register using :let @{reg} = '.
:vertical diffsplit {file}
Vim has a built-in diff mode that highlights added, removed, and changed lines between two (or more) buffers.
autocmd FileType python setlocal expandtab shiftwidth=4
Vim's autocmd FileType lets you apply settings automatically whenever a specific file type is detected.
:%normal @q
To apply a macro to every line in the file, use :%normal @q.
:cnext
The quickfix list is Vim's built-in way to collect a list of positions — typically compiler errors, grep results, or linter warnings — and jump between them
<C-r>:
Vim stores your last executed Ex command in the read-only : register.
:saveas
The :saveas {filename} command writes the current buffer to a new file and makes that new file the current buffer's file.
:options
:options opens a special Vim buffer that lists every available option, grouped by category (appearance, editing, search, etc.
:'<,'>norm @q
When you visually select lines and then type a : command, Vim automatically inserts ' (the visual range marks) into the command line.
:set exrc
Vim's exrc option tells Vim to look for a .
:nohlsearch
After a search in Vim, matched text is highlighted as long as hlsearch is enabled.
:v/pattern/command
:v (short for :vglobal) is the inverse of :g.