How do I create a custom key mapping?
:nnoremap key command
The :nnoremap command creates a non-recursive normal mode mapping.
953 results for ":normal"
:nnoremap key command
The :nnoremap command creates a non-recursive normal mode mapping.
"add
How it works When you delete text in Vim with commands like dd, dw, or x, the deleted text goes into the unnamed register and the numbered registers (1-9).
z<CR>
While zt scrolls the current line to the top of the screen, z does the same scroll but also moves the cursor to the first non-blank character of that line.
:g/outer/,/end/g/inner/
The :global command accepts a range, which lets you scope its search to sections of the file rather than the entire buffer.
999@q
Prefixing a macro invocation with a large count like 999@q tells Vim to run register q up to 999 times.
gqip
The gqip command reformats the current paragraph to fit within the configured textwidth.
/pattern
The /pattern command searches forward through the file for the given pattern.
1000@q
Vim macros stop executing the moment any step in the macro causes an error — a failed search, a motion that cannot proceed, or a substitution with no matches.
ea
The ea compound shortcut moves to the last character of the current word with e, then enters insert mode after the cursor with a.
'^
Vim automatically maintains a special mark ^ that records the exact position of the cursor the last time you left insert mode.
cis
The cis command deletes the entire sentence under the cursor and drops you into insert mode, ready to type a replacement.
qq{actions}@qq
A recursive macro ends by calling itself, so it loops automatically without you pressing @q repeatedly.
nnoremap <nowait> {key} {action}
The flag on a mapping tells Vim not to delay waiting for a longer key sequence.
V
The V (uppercase) command enters visual line mode, which selects the entire current line.
<C-f> to scroll forward, <C-b> to scroll backward
How it works Vim provides two commands for scrolling by an entire screen (page) at a time: Ctrl-F (Forward) scrolls the view one full page down through the file
( and )
How it works Vim defines a sentence as text ending with .
{count}@{register}
Prefix any macro execution with a count to repeat it that many times in a single command.
]' and ['
The ]' and [' motions let you traverse every lowercase mark set in the current buffer without needing to remember which registers you used.
:earlier
Vim's undo history is not just a linear list of changes — it records timestamps too.
"1p then u. to cycle through delete history
Vim silently maintains a rolling history of your last 9 deletions in numbered registers "1 through "9.