How do I select or operate on the content of an HTML or XML tag using text objects?
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
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
:'<,'>norm! A;
The :normal Ex command lets you execute any Normal mode keystrokes on a range of lines simultaneously, turning a single-line operation into a multi-line batch e
editing #editing #normal-mode #ex-commands #visual-mode #text-manipulation
:xmap
:vmap applies to both visual mode and select mode, which can silently break snippet plugins (like UltiSnips, LuaSnip) that use select mode to position the curso
m<
Vim's ' marks record the start and end of the last visual selection and power the ' range used by Ex commands.
{Visual}<C-a>
In Visual mode, pressing increments every number within the selection by 1 (or by a given [count]).
yiw{nav}viwp{nav}viwp
When you paste over a visual selection in Vim, the displaced text is moved into the unnamed register "".
registers #registers #visual-mode #editing #text-objects #normal-mode
:'<,'>norm .
The :'norm .
visual-mode #visual-mode #editing #normal-mode #repeat #dot-operator
gnn / grn / grm
nvim-treesitter's incremental selection module lets you grow and shrink your visual selection one syntax node at a time.
:'<,'>
Vim automatically sets two special marks whenever you make a visual selection: ' (end).
:center / :left / :right
Vim has three built-in Ex commands for aligning text without any plugins: :left, :center, and :right.
vipgq
The vipgq sequence reflowing a paragraph to fit within the width defined by textwidth (default 0, meaning no limit).
:{range}center [width]
Vim provides three built-in Ex commands for text alignment: :center, :right, and :left.
:'<,'>sort n
By default, :sort in Vim uses lexicographic (alphabetical) ordering, so "10" sorts before "2" because "1" sort n — sort selected lines by the leading number,
:'<,'>center / :'<,'>right / :'<,'>left
Vim has built-in Ex commands to align text within a specified width: :center, :right, and :left.
zp
Pastes a blockwise register like p, but skips padding lines shorter than the block's right edge with trailing spaces.
:[range]center / :[range]right / :[range]left
Vim has built-in Ex commands for text alignment: :center, :right, and :left.
<C-v>{motion}I{text}<Esc>
Visual block mode () lets you select a rectangular region across multiple lines.
V%
Pressing V% enters visual line mode on the current line and immediately extends the selection to the line containing the matching bracket or brace.
{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
O (in blockwise visual mode)
In blockwise Visual mode (), pressing O moves the cursor to the diagonally opposite corner of the rectangle.