How do I send commands from a Vim buffer to an embedded terminal?
:term then <C-w>N for normal mode
Vim 8+ and Neovim have a built-in terminal emulator that runs inside a buffer.
command-line #command-line #terminal #workflow #productivity
:term then <C-w>N for normal mode
Vim 8+ and Neovim have a built-in terminal emulator that runs inside a buffer.
command-line #command-line #terminal #workflow #productivity
:%sort u
The :sort u command sorts all lines in the file and removes duplicate lines in one operation.
command-line #command-line #ex-commands #editing #text-manipulation #sort
:%!python3 -m json.tool
The :%! command pipes the entire buffer through an external command and replaces it with the output.
command-line #command-line #shell #formatting #json #workflow
: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