How do I keep an argument list change local to the current window?
:arglocal
By default, Vim's argument list is global, so changing it in one window can unexpectedly affect another workflow in a different tab or split.
:arglocal
By default, Vim's argument list is global, so changing it in one window can unexpectedly affect another workflow in a different tab or split.
:argdo %s/foo/bar/ge | update
Bulk replacements across many files are risky when every buffer gets written unconditionally.
:argdo if search('\s\+$', 'nw') | echo expand('%') | endif
Before running destructive cleanup across many files, it helps to know which files will actually change.
command-line #command-line #search #whitespace #arglist #refactoring
:argdedupe
If you build an arglist incrementally (:args, :argadd, glob expansions), duplicates can sneak in and make :argdo workflows slower or confusing.
command-line #command-line #arglist #batch-editing #workflow
:args **/*.py | argdo %s/old/new/gc | update
Vim can perform search-and-replace across multiple files without any plugins by combining the arglist with :argdo.
search #search #substitution #ex-commands #productivity #quickfix #arglist
:args **/*.js | argdo %s/old/new/ge | update
The argument list (arglist) is Vim's mechanism for loading a set of files and running commands across all of them.
command-line #command-line #ex-commands #arglist #productivity #batch #editing