How do you yank a visual block selection to a register?
<C-v>jjll"ay
Enter visual block mode with , select the block, then "ay to yank the block into register a.
432 results for "visual mode"
<C-v>jjll"ay
Enter visual block mode with , select the block, then "ay to yank the block into register a.
O (in blockwise visual mode)
In blockwise Visual mode (), pressing O moves the cursor to the diagonally opposite corner of the rectangle.
O (visual-block)
In Visual-Block mode (), pressing O moves the cursor to the diagonally opposite corner of the rectangular selection.
{visual}p
When you visually select text and press p, Vim replaces the selection with the contents of the default register and saves the replaced text into the unnamed reg
<C-v>selection r{char}
In visual block mode, pressing r followed by a character replaces every character in the selected rectangle with that character.
v/pattern<CR>
Starting a search while in visual mode extends the selection to the search match.
>gv
Normally, pressing > in visual mode indents the selection but exits visual mode, requiring you to press gv to reselect.
<C-v>jjI1. <Esc>
Visual block insert can add numbered prefixes to lines.
:
In Visual mode, typing : does more than open the command line: Vim automatically inserts the exact selection range as '.
:'<,'>s/\%Vpattern/replacement/g
Using \%V in a substitute pattern restricts matching to within the visual block area only, rather than the full lines.
vi{a{
In visual mode, you can expand your selection to include outer nested blocks by pressing additional text object commands.
:'<,'>normal @q
The :'normal @q command runs macro q on every line of the visual selection.
g<C-a> in visual mode
When you have multiple lines with the same number and want to turn them into a sequence (1, 2, 3.
f{vi{U
When editing structured text, you often need to transform content inside delimiters without touching the delimiters themselves.
v3aw
In visual mode, repeating text object motions progressively expands the selection.
<C-n> to select (vim-visual-multi)
vim-visual-multi provides VS Code-style multiple cursor support for Vim.
gq (visual mode)
Pressing gq on a visual selection reformats the selected lines to hard-wrap at textwidth columns.
* (in visual mode)
In normal mode, searches for the word under the cursor with word-boundary anchors.
<C-v>jj$A
Combining visual block mode with $ and A lets you append text at the end of multiple lines, even when the lines have different lengths.
:'<,'>!awk '{print toupper($0)}'
Vim can pipe any visual selection through external Unix commands and replace the selection with the output.
visual-mode #visual-mode #external-command #awk #text-transformation