How do I move to the first non-blank character of a line?
^
The ^ command moves the cursor to the first non-blank character of the current line.
953 results for ":normal"
^
The ^ command moves the cursor to the first non-blank character of the current line.
?pattern
The ?pattern command searches backward through the file for the given pattern, starting from the cursor position and wrapping around to the end of the file if n
gU{motion} / gu{motion} / g~{motion}
Vim has three case operators that work with any motion or text object: gU for uppercase, gu for lowercase, and g~ for toggle case.
editing #editing #case #operators #text-objects #normal-mode
1z=
The z= command opens an interactive numbered menu of spelling corrections for the word under the cursor, requiring you to type a number and press Enter.
qQ (or any uppercase register letter)
When recording a macro with qq, you can append additional keystrokes to the existing macro by recording into the uppercase version of the same register.
gm
The gm command moves the cursor horizontally to the middle of the current screen width on the current line.
zr and zm
The zr and zm commands let you incrementally adjust the global fold depth across the entire buffer — one level at a time.
:set showcmd
The showcmd option makes Vim display the currently-typed command in the bottom-right corner of the screen, giving you live feedback as you build up key sequence
H
The H command moves the cursor to the first line of the currently visible screen (the "High" position).
"-
Vim silently stores every deletion of less than one line in the special "- register (the "small delete" register).
:let @a = @a . @b
You can manipulate register contents directly using the :let command with the @{reg} syntax.
:%s/\(\w\+\)/\u\L\1/g
Vim's substitute command supports case-conversion escape sequences in the replacement string.
\@<=
The \@<= operator is Vim's zero-width look-behind assertion.
Q
In Neovim, the Q key is mapped to replay the last executed macro — the same as @@ in both Vim and Neovim.
gv
The gv command reselects the exact same area that was last selected in visual mode.
<C-w>f
How it works You may already know that gf opens the file path under the cursor in the current window.
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.
:%s/\%Vpattern/replacement/g
The \%V atom restricts a regex match to the last visual selection — more precisely than :'s/.
\@=
Vim's regex engine supports zero-width lookahead and lookbehind assertions using the \@ family of atoms.
:set cursorlineopt=number
When cursorline is enabled, Vim highlights the entire line the cursor is on.