How do I shift-indent all lines from the current cursor position to the end of the file?
>G
The >G command applies a right-indent shift to every line from the cursor through the last line of the buffer.
953 results for ":normal"
>G
The >G command applies a right-indent shift to every line from the cursor through the last line of the buffer.
&
The & command in normal mode repeats the last :s substitution on the current line.
search #search #substitution #ex-commands #repeat #normal-mode
zi
Pressing zi in normal mode toggles the foldenable option, which controls whether folds are active in the current window.
*NgUgn
gn is often treated as a visual selection command, but it is more powerful when used as a motion target for operators.
:nnoremap <expr> j (v:count == 0 ? 'gj' : 'j')
Expression mappings use the flag to evaluate a Vimscript expression at the time the key is pressed.
<Cmd>
The pseudo-key in Neovim allows a mapping to execute an Ex command directly, without going through command-line mode.
g<C-g>
While shows basic file info (filename, line count, position), g provides a much more detailed statistical breakdown of your file or visual selection.
{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.
d<C-v>2j
Vim lets you override the natural type of any motion by pressing v, V, or between the operator and the motion.
editing #editing #motions #visual-mode #advanced #normal-mode
@@
How it works After running a macro with @a (or any other register), you can repeat that same macro by pressing @@.
<C-v>$
In visual block mode, pressing $ extends the selection to the end of every line, even when lines have different lengths.
.\{-}
How it works In most regex engines, ? or +? make quantifiers non-greedy (matching as little as possible).
qagUiwWq2@a
Macros are most powerful when they encode both the edit and the movement to the next target.
[i
Pressing [i in normal mode displays the first line above the cursor (including included files) that contains the keyword under the cursor.
"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
''
When you jump around a file, Vim tracks prior locations.
navigation #navigation #motions #marks #jumplist #normal-mode
p
The p command pastes (puts) the contents of the default register after the cursor.
:g/pattern/join
The :g/pattern/join command combines the :global command with :join to merge every line matching a pattern with the line immediately following it.
command-line #ex-commands #editing #command-line #search #normal-mode
gUip
gUip is a compact operator-plus-text-object pattern that uppercases exactly the paragraph your cursor is in.
mzgUiw`z
When you run an operator like gUiw, Vim can leave your cursor in a slightly different place than where you started.