How do I run a command on every file in the quickfix list?
:cdo s/old/new/g | update
The :cdo command executes a given command on every entry in the quickfix list.
command-line #command-line #quickfix #batch-editing #search #multi-file
:cdo s/old/new/g | update
The :cdo command executes a given command on every entry in the quickfix list.
command-line #command-line #quickfix #batch-editing #search #multi-file
:cq
The :cq command quits Vim and returns a non-zero exit code to the calling process.
:make
The :make command runs your build tool and parses its output into the quickfix list, letting you jump directly to each error location.
command-line #command-line #quickfix #build #workflow #programming
:'a,'b s/old/new/g
Marks can be used as range specifiers in any Ex command.
command-line #marks #command-line #ex-commands #ranges #editing
:g/pattern/y A
The :g/pattern/y A command yanks every line matching the pattern and appends it to register a.
command-line #command-line #registers #global #ex-commands #filtering
:g/pattern/m$
The :g (global) command combined with :m (move) relocates all matching lines to a specified destination.
command-line #command-line #ex-commands #global #editing #organization
:X
The :X command sets an encryption key for the current file.
command-line #command-line #security #file-management #ex-commands
:'<,'>normal A;
The :normal command executes normal-mode keystrokes on every line in a range.
command-line #command-line #ex-commands #editing #normal-mode #batch-editing
!{motion}command
The ! operator in normal mode pipes text through an external shell command and replaces it with the output.
:e scp://user@host//path/to/file
Vim's built-in netrw plugin supports editing files over the network using protocols like SCP, SFTP, and HTTP.
:%!column -t
The column -t command formats whitespace-separated text into neatly aligned columns.
command-line #command-line #shell #formatting #text-manipulation
:cwindow
The :cwindow command intelligently manages the quickfix window — it opens the window only if there are entries in the quickfix list, and closes it if the list
:redir @a | {cmd} | redir END
The :redir command redirects the output of Ex commands to a register, file, or variable instead of displaying it on the screen.
command-line #command-line #ex-commands #registers #productivity #advanced
@:
The @: command re-executes the most recently run Ex command (any command starting with :).
command-line #command-line #ex-commands #repeat #normal-mode #productivity
:g/^/m0
The :g/^/m0 command is a clever use of Vim's global command to reverse every line in the file.
:'<,'>norm {commands}
The :normal (or :norm) command lets you execute normal mode keystrokes from the command line.
command-line #editing #ex-commands #normal-mode #productivity #ranges
:w !{cmd}
The :w !{cmd} command writes the buffer contents to the stdin of an external shell command without modifying the buffer or saving to disk.
command-line #command-line #ex-commands #shell #editing #productivity
:%!{cmd}
The :%!{cmd} command pipes the entire buffer through an external shell command and replaces the buffer contents with the command's output.
command-line #editing #ex-commands #shell #filtering #productivity
q:
The command-line window is a special buffer that shows your entire Ex command history and lets you edit entries using the full power of Vim's normal mode before
command-line #command-line #ex-commands #history #editing #productivity
:10,20t30
The :t command (short for :copy) duplicates lines from one location to another without touching any registers.
command-line #editing #ex-commands #lines #productivity #ranges