How do I open the command-line window while typing a command on the : prompt?
<C-f> (from command-line mode)
When you are partway through typing a long or complex Ex command on the : prompt, you can press to open the command-line window.
640 results for "/pattern"
<C-f> (from command-line mode)
When you are partway through typing a long or complex Ex command on the : prompt, you can press to open the command-line window.
:silent! %normal @q
Combining :silent!, the % range, and :normal @q gives you a powerful pattern for applying a macro across an entire file while gracefully skipping lines that don
<C-a> in insert mode
Pressing while in insert mode inserts the same text that was typed during the previous insert mode session.
<C-r><C-r>
In command-line mode, {reg} inserts a register's contents — but it processes certain sequences, potentially misinterpreting backslashes, pipe characters, or e
di(
The di( command deletes everything inside the nearest pair of parentheses without removing the parentheses themselves.
:set regexpengine=1
Vim ships with two regex engines and lets you control which one is used.
@q
A recursive macro is a macro that calls itself as its last step, causing it to loop automatically until an operation fails (such as reaching the end of the file
<C-f> (from command-line)
When you are already in the middle of typing a command (after pressing :) and realize you need to compose something complex — a long substitution, a multi-pip
: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
Harpoon: mark files and jump with <leader>1-4
Harpoon by ThePrimeagen provides instant access to a curated list of files you're actively working on.
: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.
qaYp<C-a>q99@a
By recording a macro that duplicates a line and increments its number, you can generate a numbered list of any length with a single replay command.
macros #macros #editing #normal-mode #automation #productivity
qaqqa...@aq
A recursive macro calls itself at the end of its recording, creating a loop that repeats until a motion or command fails (like reaching the end of the file or f
:lopen / :lnext / :lprev
The location list is a per-window variant of the quickfix list.
buffers-windows #navigation #quickfix #ex-commands #windows #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
ciw""<Esc>P
Vim doesn't have a built-in "surround" operator, but you can wrap any word in quotes or brackets with a short sequence: ciw""P.
editing #editing #text-objects #normal-mode #productivity #surround
vim: set ts=2 sw=2 :
A modeline is a special comment embedded in a file that Vim reads to apply file-specific settings automatically.
<Leader><Leader>w
The vim-easymotion plugin replaces Vim's default motion commands with a visual overlay system that lets you jump to any visible position on screen in just two o
s{char}{char}
The vim-sneak plugin by Justin Keyes provides a motion that lets you jump to any visible location by typing just two characters.
<C-n>
The vim-visual-multi plugin (formerly vim-multiple-cursors) brings VS Code-style multiple cursor editing to Vim.
plugins #plugins #visual-multi #editing #multiple-cursors #refactoring