How do I insert text at the beginning of multiple lines at once using visual block mode?
<C-v>I
Visual block mode's I command lets you type once and have the text inserted at the cursor column across all selected lines simultaneously.
870 results for "it at"
<C-v>I
Visual block mode's I command lets you type once and have the text inserted at the cursor column across all selected lines simultaneously.
zr
zr ("reduce" fold level) decrements the global foldlevel option by 1, opening the next layer of folds across the entire file.
zb
The zb command redraws the screen with the current line at the bottom of the window.
0 or ^ at start of macro
A common macro pitfall is assuming the cursor starts at a specific column.
qaA;<Esc>jq
This macro appends a semicolon to the current line and moves down, ready to repeat.
it and at
Vim provides two built-in text objects for HTML and XML tags: it (inner tag) and at (a tag).
editing #text-objects #editing #visual-mode #html #normal-mode
:s/\%#\k\+/REPL/
Most substitutions operate on broad ranges, but sometimes you want a precise edit anchored to where your cursor is right now.
/\%5l\%10cpattern
Vim provides position-matching atoms that constrain where a pattern can match based on line numbers, column positions, or virtual columns.
I
The I (uppercase) command moves the cursor to the first non-blank character of the current line and enters insert mode.
:set statusline=%f\ %m%r%=%l/%L
The statusline option controls what information is shown in the status bar at the bottom of each window.
:earlier 10m
The :earlier command restores the buffer to its state at a specific time in the past.
<C-v>j$A;<Esc>
When lines have varying lengths, a normal visual block selection stops at the shortest line.
Plug 'sheerun/vim-polyglot'
vim-polyglot is a collection of language packs for Vim.
<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.
\&
Vim's \& operator is the AND combinator in a search pattern.
gI
Most Vim users know I to insert at the start of a line — but I actually jumps to the first non-blank character, skipping leading whitespace.
\%^ and \%$
Vim's ^ and $ anchors match the start and end of a line, but sometimes you need to match the very beginning or very end of the entire buffer.
:set sidescroll=1
When wrap is off and the cursor moves past the edge of the screen, Vim jumps the view horizontally by a number of columns determined by sidescroll.
zh and zl
When wrap is disabled, long lines extend off-screen.
:set nomore
When a Vim command produces output that exceeds the terminal height, Vim pauses and displays a -- More -- prompt, requiring you to press a key to continue.