How do I select text character by character in Vim?
Answer
v
Explanation
The v command enters character-wise visual mode, letting you select text one character at a time. This is the most basic form of visual selection.
How it works
- Press
vto start selection at the cursor - Move with any motion to extend the selection
- The selection is highlighted as you move
- Perform an action on the selection (d, y, c, etc.)
Example
hello world
Press v on h, then e to select hello. Press d to delete it.
Tips
Venters line-wise visual mode<C-v>enters block-wise visual modegvreselects the last visual selectionoswaps to the other end of the selection<Esc>cancels the selection