How do I clear or empty a macro register in Vim?
qaq
How it works To clear a macro register, you simply start recording into that register and immediately stop.
953 results for ":normal"
qaq
How it works To clear a macro register, you simply start recording into that register and immediately stop.
crs / crc / crm / cru
The vim-abolish plugin adds coercion operators that instantly convert the word under the cursor between common naming conventions.
plugins #editing #text-objects #plugins #normal-mode #formatting
gP
The gP command works like P (paste before the cursor) but leaves your cursor after the pasted text rather than at its beginning.
de
The de command deletes from the cursor position to the end of the current word.
/\Cpattern
Vim's ignorecase and smartcase settings change how all searches behave globally.
:%s/\r//g
When a file created on Windows is opened in Vim on a Unix system, lines may retain \r (carriage return) characters, displayed as ^M at the end of each line.
]# and [#
Vim provides the ]# and [# motions specifically for navigating C preprocessor conditionals.
q/
How it works Vim keeps a history of all your search patterns.
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
gcc / gc{motion}
The vim-commentary plugin by Tim Pope provides a simple, operator-based way to comment and uncomment code.
/\%V
The \%V pattern atom restricts a search to the region spanned by the last visual selection.
zm
Instead of jumping between fully open (zR) and fully closed (zM), zm and zr let you step through fold levels one at a time.
:set tildeop
By default, ~ toggles the case of a single character and advances the cursor.
/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.
cx{motion} … cx{motion} (vim-exchange)
The vim-exchange plugin provides cx{motion} to mark a region, then cx{motion} again on a second region to swap them in place.
:%s/\w\+/\u&/g
Vim's substitute command supports case-conversion modifiers in the replacement string.
set nrformats+=alpha
By default, Vim's and commands only increment and decrement numbers (decimal, hex, binary).
]m / [m
When you're reviewing or refactoring C-style code, jumping by words or paragraphs is too coarse, and search can become noisy.
navigation #navigation #motions #code-navigation #normal-mode
A
The A command moves the cursor to the end of the current line and enters insert mode.
gj / gk
When a long line wraps across multiple screen rows, the regular j and k motions skip the entire logical line.