How do I repeat the last change in Vim?
.
The .
370 results for "insert mode"
.
The .
"/
Vim stores the last search pattern in the special / register.
<C-v>jjc replacement<Esc>
Visual block mode's change command lets you replace a rectangular column of text across multiple lines in a single operation.
visual-mode #editing #visual-mode #block-mode #normal-mode #productivity
:set nomodifiable
:set nomodifiable locks a buffer so that no changes can be made at all — not even temporary ones.
<C-v>I#<Esc>
Vim's Visual Block mode lets you prepend characters (like comment markers) to multiple lines simultaneously.
:let @a = system('cmd')
You can populate any Vim register with the output of an external shell command using :let @{register} = system('{command}').
v{motion}<C-g>
Vim has a lesser-known select mode that behaves like selection in typical GUI editors: any typed character replaces the selection.
r{char} in visual mode
In visual mode, pressing r followed by a character replaces every character in the selection with that single character.
ci" / ci( / ci{ / ci[ / ci` / ci'
The ci{delimiter} family of commands changes the text inside any matching pair of delimiters.
editing #editing #text-objects #change #delimiters #normal-mode
"qp {edit} 0"qy$ dd
When you record a macro and realize it has a mistake, the easiest fix is to paste the macro's keystrokes as text, edit them, and yank the corrected version back
gw
The gw operator reformats text to fit within textwidth, just like gq — but with one key difference: gw leaves the cursor in its original position after format
qa0f=20i <Esc>20|C= <Esc>lDjq
How it works Aligning text on a delimiter such as = without plugins requires a clever macro technique.
%:e
Vim exposes the current filename as % in Ex commands, and you can apply modifiers to extract specific parts of the path.
g; and g,
Vim tracks every position where you made a change in the changelist.
<C-v>{motion}$A
In visual block mode, pressing $ makes the right edge of the selection "ragged" — it extends to the real end of each line regardless of length.
:lua vim.diagnostic.config({virtual_text = false})
Neovim's built-in diagnostic system (vim.
:registers
The :registers command displays the contents of all Vim registers, showing you exactly what text is stored in each one.
highlight TrailingWhitespace ctermbg=red and match TrailingWhitespace /\s\+$/
How it works Vim's highlight and match commands let you create custom visual indicators.
"+p
The "+p command pastes the contents of the system clipboard into Vim.
gh
Vim's Select mode behaves like the familiar selection model in most GUI editors: after selecting text, any printable character you type replaces the selection a