How do I replace a visual block selection with digraph or special characters?
Answer
<C-v>jjr<C-k>12
Explanation
Visual block mode combined with the replace command and digraph input lets you replace a column of characters with special Unicode characters. By pressing r followed by <C-k> and a digraph code, every character in the block selection is replaced with the chosen special character.
How it works
<C-v>jj— select a vertical block of charactersr— enter replace mode for the entire selection<C-k>— activate digraph input- Type a two-character digraph code (e.g.,
12for ½,*for bullet) - All selected characters are replaced simultaneously
Example
Before:
| x | data1 |
| x | data2 |
| x | data3 |
After <C-v>jjr<C-k>OK (✓ digraph):
| ✓ | data1 |
| ✓ | data2 |
| ✓ | data3 |
Tips
- Use
:digraphsto see all available digraph codes - Common digraphs:
OK→ ✓,XX→ ✗,*2→ ★,13→ ⅓,Db→ ◆ <C-k>works in any insert/replace context, not just visual block- Use
gaon any character to see its digraph code