How do I change the case of matched text in a Vim substitute command?
\u and \l in :s replacement
Vim's substitute command supports special case modifiers in the replacement string that let you change the case of captured text on the fly.
2277 results for "@a"
\u and \l in :s replacement
Vim's substitute command supports special case modifiers in the replacement string that let you change the case of captured text on the fly.
<C-w>z
Pressing z closes the preview window from any window in the current tab page.
<C-f> (command-line mode)
Pressing while in the command-line (:, /, or ? prompt) opens the command-line window with your partially-typed command already loaded and ready for full Vim edi
command-line #command-line #ex-commands #editing #navigation
n.
The n.
:%s//new/g
Leaving the search field empty in a :s command tells Vim to reuse the last search pattern from / or .
search #search #substitution #ex-commands #regex #productivity
` vs '
Vim offers two ways to jump to a mark, and the difference is crucial: the backtick (` `) jumps to the exact line and column where the mark was set, while the si
:'<,'>!{cmd}
After making a visual selection and entering the command line with :, Vim automatically inserts the range ' for the selection.
m'
Vim's jump list automatically records your position whenever you make large motions (like G, /pattern, or ).
:%s/pattern//n
The n flag in the substitute command suppresses the actual replacement and instead reports the match count.
zO and zC
zO and zC are the recursive counterparts to zo and zc.
:g/pattern/.-1,.+1d
The :g (global) command normally operates on lines that match a pattern.
gM
The gM command moves the cursor to the horizontal middle of the current line, regardless of how long the line is.
ZZ
ZZ is a normal mode shorthand that saves and quits only if the buffer has been modified.
:keepmarks {command}
Many batch edits in Vim update special marks like '[ and '], which can disrupt follow-up motions or tooling that depends on those positions.
navigation #navigation #marks #command-line #refactoring #editing
<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.
qa{edits}@bq
How it works Vim macros can call other macros, creating a modular system of reusable building blocks.
O (visual block mode)
In visual block mode (), pressing O (uppercase) moves your cursor to the other end of the current line — letting you expand or contract the block's horizontal
<C-l> during / search
When searching with incsearch enabled, Vim highlights matches as you type.
:'<,'>!column -t
When working with data that has uneven spacing — such as variable assignments, CSV-like data, or configuration entries — you can select the lines and pipe t
visual-mode #visual-mode #editing #formatting #external-command #alignment
O (in blockwise visual mode)
In blockwise Visual mode (), pressing O moves the cursor to the diagonally opposite corner of the rectangle.