How do I send the contents of my buffer to a shell command without replacing the text?
The :w !{cmd} command writes the buffer contents to the stdin of an external shell command without modifying the buffer or saving to disk.
category:
command-line
tags:
#command-line
#ex-commands
#shell
#editing
#productivity
How do I edit and reuse previous Ex commands in a full editing buffer?
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
category:
command-line
tags:
#command-line
#ex-commands
#history
#editing
#productivity
How do I perform the same operation across multiple files using the argument list?
: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.
category:
command-line
tags:
#command-line
#ex-commands
#arglist
#productivity
#batch
#editing
How do I specify line ranges in Ex commands to target specific parts of a file?
Every Ex command in Vim can be preceded by a range that specifies which lines it should operate on.
category:
command-line
tags:
#command-line
#ex-commands
#ranges
#editing
#productivity
How do I save a file I opened without sudo permissions?
The :w !sudo tee % command lets you save a file that requires root permissions, even if you forgot to open Vim with sudo.
category:
command-line
tags:
#command-line
#ex-commands
#editing
How do I run a shell command from inside Vim?
The :!command syntax lets you execute any shell command directly from within Vim without leaving the editor.
category:
command-line
tags:
#command-line
#ex-commands
#editing
How do I open a terminal inside Vim?
The :terminal command opens an interactive terminal emulator directly inside a Vim window.
category:
command-line
tags:
#command-line
#ex-commands
#buffers-windows
How do I insert the output of a shell command into my file?
The :r !command command executes a shell command and inserts its output directly into the current buffer below the cursor line.
category:
command-line
tags:
#command-line
#ex-commands
#editing
How do I run a normal mode command on every line matching a pattern?
The :g/pattern/normal {commands} command executes normal mode keystrokes on every line in the file that matches the given pattern.
category:
command-line
tags:
#ex-commands
#command-line
#editing
#search
How do I run a command on every line matching a pattern?
The :g/pattern/command (global) command executes an Ex command on every line in the file that matches the given pattern.
category:
command-line
tags:
#ex-commands
#search
#editing
#command-line
How do I run a search and replace across multiple files?
:cfdo %s/old/new/g | update
The :cfdo %s/old/new/g update command performs a search and replace across every file in the quickfix list and saves each one.
category:
command-line
tags:
#command-line
#ex-commands
#search
#editing
How do I delete all lines matching a pattern?
The :g/pattern/d command deletes every line in the file that matches the given pattern.
category:
command-line
tags:
#search
#ex-commands
#editing
#command-line