automatically when you press ":" in Visual
mode.
==============================================================================
5. Blockwise operators *blockwise-operators*
Reminder: Use 'virtualedit' to be able to select blocks that start or end
after the end of a line or halfway through a tab.
Visual-block Insert *v_b_I*
With a blockwise selection, I{string}<ESC> will insert {string} at the start
of block on every line of the block, provided that the line extends into the
block. Thus lines that are short will remain unmodified. TABs are split to
retain visual columns. Works only for adding text to a line, not for
deletions. See |v_b_I_example|.
Visual-block Append *v_b_A*
With a blockwise selection, A{string}<ESC> will append {string} to the end of
block on every line of the block. There is some differing behavior where the
block RHS is not straight, due to different line lengths:
1. Block was created with <C-v>$
In this case the string is appended to the end of each line.
2. Block was created with <C-v>{move-around}
In this case the string is appended to the end of the block on each line,
and whitespace is inserted to pad to the end-of-block column.
See |v_b_A_example|.
Note: "I" and "A" behave differently for lines that don't extend into the
selected block. This was done intentionally, so that you can do it the way
you want.
Works only for adding text to a line, not for deletions.
Visual-block change *v_b_c*
All selected text in the block will be replaced by the same text string. When
using "c" the selected text is deleted and Insert mode started. You can then
enter text (without a line break). When you hit <Esc>, the same string is
inserted in all previously selected lines.
Visual-block Change *v_b_C*
Like using "c", but the selection is extended until the end of the line for
all lines.
*v_b_<*
Visual-block Shift *v_b_>*
The block is shifted by 'shiftwidth'. The RHS of the block is irrelevant. The
LHS of the block determines the point from which to apply a right shift, and
padding includes TABs optimally according to 'ts' and 'et'. The LHS of the
block determines the point up to which to shift left.
See |v_b_>_example|.
See |v_b_<_example|.
Visual-block Replace *v_b_r*
Every screen char in the highlighted region is replaced with the same char, ie
TABs are split and the virtual whitespace is replaced, maintaining screen
layout.
See |v_b_r_example|.
==============================================================================
6. Repeating *visual-repeat*
When repeating a Visual mode operator, the operator will be applied to the
same amount of text as the last time:
- Linewise Visual mode: The same number of lines.
- Blockwise Visual mode: The same number of lines and columns.
- Normal Visual mode within one line: The same number of characters.
- Normal Visual mode with several lines: The same number of lines, in the
last line the same number of characters as in the last line the last time.
The start of the text is the Cursor position. If the "$" command was used as
one of the last commands to extend the highlighted text, the repeating will
be applied up to the rightmost column of the longest line. Any count passed
to the `.` command is not used.
Visual mode |default-mappings| "@" and "Q" repeat a register for all selected
lines if the selection is linewise. See |v_@-default| and |v_Q-default| for
details. For example, given the text:
123(hello)321
456(world)654
456(NOT THIS)654
With register "x" containing the commands `yi(VP`, visually selecting the
first two lines and typing `@x` produces:
hello
world
456(NOT THIS)654
==============================================================================
7. Examples *visual-examples*
*:visual_example*
Currently the ":" command works on whole lines only. When you select part of
a line, doing something like ":!date" will replace the whole line. If you
want only part of