How do I use count prefixes to amplify motions and operators in Vim?
{count}{motion}
Almost every Vim motion and operator accepts a numeric count prefix that repeats or amplifies the action.
953 results for ":normal"
{count}{motion}
Almost every Vim motion and operator accepts a numeric count prefix that repeats or amplifies the action.
:/start/,/end/command
Vim allows pattern-based ranges in Ex commands, letting you operate on lines between two search matches.
vitU
When editing markup-heavy files, you often need to transform only the tag contents while preserving the surrounding structure.
:cnoremap <C-a> <Home>
Vim's command line has limited navigation by default.
:smagic/\vfoo.+/bar/
If you prefer very-magic regex syntax but don't want to change global settings, :smagic is a targeted solution.
q/k?pattern<CR>
Vim's command-line history window (q: for Ex commands, q/ for search) opens a full editing buffer containing your history.
`"
The " mark is an automatic mark Vim sets whenever you leave a buffer — switching to another file, hiding the buffer, or quitting Vim (with viminfo/shada enabl
gj and gk
When wrap is enabled, long lines wrap across multiple screen lines.
<C-r><C-r>"
In Insert mode, plain {register} inserts register content but may reindent or auto-format depending on context.
registers #registers #insert-mode #editing #indentation #text
@=
The @= command lets you type a Vimscript expression and execute the result as if it were a macro.
/\V<C-r>=histget('/', -2)<CR>
If you often alternate between two complex search patterns, opening q/ each time is slow.
:diffoff!
The :diffoff! command exits diff mode in every window simultaneously.
:setlocal winfixheight winfixwidth
If you use a dedicated utility pane (logs, quick notes, REPL output), Vim's default equalization behavior can keep resizing it whenever other splits change.
: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).
\@!
In Vim's regex engine, \@! is the negative lookahead assertion.
:set conceallevel=2
The conceallevel option controls how Vim displays characters that have the "conceal" syntax attribute.
:/BEGIN/,/END/-1s/\s\+$//
When you need to clean or refactor block-like regions, Ex ranges can target lines between two search patterns without selecting text manually.
command-line #command-line #ex-commands #ranges #search #editing
:set wrapscan!
wrapscan controls what happens when a / or ? search reaches the end (or beginning) of the file.
:let @q .= 'j'
Re-recording a long macro just to add one extra keystroke is wasteful and error-prone.
:undojoin<CR>
By default, separate edits often become separate undo entries, which makes replaying or backing out a multi-part change noisy.