How do I insert the same text on multiple lines at once?
<C-v>jjjI
Visual block mode combined with I lets you insert the same text at the beginning of multiple lines simultaneously.
<C-v>jjjI
Visual block mode combined with I lets you insert the same text at the beginning of multiple lines simultaneously.
<C-v>
The (Ctrl+v) command enters visual block mode, which lets you select a rectangular column of text across multiple lines.
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
:'<,'>sort
The :'sort command sorts the currently selected lines in visual mode alphabetically.
gv
The gv command reselects the exact same area that was last selected in visual mode.
:'<,'>normal @a
The :'normal @a command executes the macro stored in register a on every line within the current visual selection.
g<C-a>
The g command increments numbers across a visual selection so that each subsequent line gets a progressively higher value.
vi"
The vi" command visually selects all text inside double quotes, without including the quotes themselves.
visual-mode #visual-mode #text-objects #editing #normal-mode