How do I paste text above the current line?
P
The P (uppercase) command pastes the contents of the default register before the cursor position.
414 results for "G"
P
The P (uppercase) command pastes the contents of the default register before the cursor position.
:%norm A;
The :%norm command runs normal mode commands on every line in the file (or a range).
\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.
{count}<C-a> / {count}<C-x>
While increments and decrements a number by 1, you can prefix either with a count to add or subtract a specific amount.
qa...@aq
A recursive macro calls itself at the end of its recording, causing it to repeat until a motion or search fails.
:pop or <C-t>
When you jump to a tag definition with , Vim pushes your location onto a tag stack.
:%normal @q
To apply a macro to every line in the file, use :%normal @q.
/pattern\@<=match
Vim supports zero-width assertions (lookahead and lookbehind) in its regex engine, allowing you to match text based on what precedes or follows it without inclu
qq;.q then @q or @@
The dot command (.
:s/\v(pattern1)(pattern2)/\2\1/
Vim's substitute command supports capture groups (also called backreferences), which let you rearrange matched portions of text.
:set nrformats+=alpha
By default, and only increment and decrement numbers (decimal, hex, and octal depending on format).
:%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
/\%>10l\%<20lpattern
Vim's \%>Nl and \%10l matches only after line 10 \%10l\%10l\%<20lold/new/g Combine with column restrictions for precise region targeting Tips Line numbers in \%
:wall
When working across multiple files, you often have unsaved changes in several buffers.
/\Cpattern
Vim's ignorecase and smartcase settings change how all searches behave globally.
ga
The ga command displays the ASCII/Unicode value of the character under the cursor in decimal, hexadecimal, and octal.
editing #editing #unicode #debugging #normal-mode #inspection
<C-a> (in insert mode)
While in insert mode, pressing re-inserts whatever text you typed during your previous insert session.
/\(pattern\)\@<=target or /target\(pattern\)\@=
Vim supports zero-width assertions (lookahead and lookbehind) in its regex engine.
/foo\|bar
How it works The \ operator in Vim's search pattern works like a logical OR, letting you match any one of several alternatives.
:<C-r>"
When typing an Ex command or search pattern, you often need to insert text you've already yanked or deleted.