How do I toggle the case of a character in Vim?
~
The ~ command toggles the case of the character under the cursor — uppercase becomes lowercase and vice versa — then advances the cursor one position to the
~
The ~ command toggles the case of the character under the cursor — uppercase becomes lowercase and vice versa — then advances the cursor one position to the
u
The u command undoes the last change you made in normal mode.
gUiw
The gUiw command converts the entire word under the cursor to uppercase.
:registers
The :registers command displays the contents of all Vim registers, showing you exactly what text is stored in each one.
<C-v>
The (Ctrl+v) command enters visual block mode, which lets you select a rectangular column of text across multiple lines.
yy
The yy command yanks (copies) the entire current line, including the newline character.
"+y
The "+y command yanks (copies) text into the system clipboard register, making it available to paste in other applications outside of Vim.
/pattern
The /pattern command searches forward through the file for the given pattern.
#
The # command searches backward for the exact word under the cursor, jumping to the previous occurrence.
*
The command searches forward for the exact word under the cursor, jumping to the next occurrence.
vat
The vat command visually selects the nearest enclosing HTML or XML tag and all of its contents, including the opening and closing tags themselves.
visual-mode #visual-mode #text-objects #editing #normal-mode
V
The V (uppercase) command enters visual line mode, which selects the entire current line.
vi{
The vi{ command visually selects everything inside the nearest pair of curly braces {}, without selecting the braces themselves.
visual-mode #visual-mode #text-objects #editing #normal-mode
vip
The vip command visually selects the inner paragraph — all contiguous non-blank lines surrounding the cursor.
visual-mode #visual-mode #text-objects #editing #normal-mode
ma and 'a
The ma command sets a mark named a at the current cursor position.
:set relativenumber
The :set relativenumber command displays line numbers relative to the cursor position instead of absolute line numbers.
<C-r>
The (Ctrl+r) command redoes the last change that was undone with u.
gqip
The gqip command reformats the current paragraph to fit within the configured textwidth.
r{char}
The r{char} command replaces the character under the cursor with {char} without ever entering insert mode.
10@a
The 10@a command replays the macro recorded in register a exactly 10 times.