How do you run a command across all files in the argument list?
:argdo %s/old/new/ge | update
Use :argdo to execute a command in every file in the argument list.
48 results for ":argdo"
:argdo %s/old/new/ge | update
Use :argdo to execute a command in every file in the argument list.
:argdo normal @a
The :argdo command applies any Ex command to every file in the argument list.
:argdo update
When working through an argument list, many files may remain unchanged.
command-line #command-line #buffers #ex-commands #refactoring
:argdo %s/old/new/g | update
The :argdo command runs an Ex command on every file in the argument list (the files you opened Vim with, or added via :argadd).
:args **/*.py | argdo %s/old/new/ge | update
Combining :args, :argdo, and :update gives you a powerful in-editor multi-file search and replace without leaving Vim.
:argdo norm @a | update
Combining :argdo with :norm @a lets you apply a recorded macro to every file in Vim's argument list — a powerful pattern for bulk refactoring across a project
:argdo %s/\s\+$//e | update
When you need to clean up many files at once, :argdo lets you run the same command on every buffer in your argument list.
:argdo normal @q | update
The :argdo command runs a command in every file in the argument list.
macros #macros #batch-editing #multi-file #ex-commands #workflow
:argdo %s/foo/bar/ge | update
Bulk replacements across many files are risky when every buffer gets written unconditionally.
:argdo %s/\<old\>/new/ge | update
When you need to apply the same substitution across a curated set of files, :argdo is safer than a broad project-wide command.
command-line #command-line #ex-commands #search #buffers #formatting
:argdo execute 'normal @q' | update
:argdo runs an Ex command on every file in Vim's argument list (the arglist).
: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
: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
:argdo %s/old/new/g | w
:argdo {cmd} executes an Ex command against every file in the argument list—the set of files you opened Vim with or set explicitly with :args.
: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 {pattern}
The :args command sets Vim's argument list to all files matching a glob pattern.
: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
Vim's argument list (arglist) is a named list of files that you can operate on as a group.
: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.
:args **/*.js
The :args command populates Vim's argument list with files matching a glob pattern, turning any set of files into a navigable list and enabling project-wide bat