this post was submitted on 20 Feb 2025
15 points (100.0% liked)

Neovim

2301 readers
1 users here now

founded 2 years ago
MODERATORS
 

I've been using Neovim for about eight years, but I knever knew about :help o_CTRL-V until today. It lets you perform a command over a column.

I had the code below and wanted to remove all trailing colons:

foo:
bar:
baz:
faz:

What I meant to do was to do was (with the cursor on the first line) $<C-v>3jd to visually select all colons and then delete them. But I accidentally did $d<C-v>3j, which, to my surprise, did the same thing.

I did know about :help o_V, which lets you turn a characterwise operation like di{ into a line-wise one by doing dVi{. But it never occurred to me that I could do the same thing with <C-v>.

top 1 comments
sorted by: hot top controversial new old
[–] [email protected] 6 points 1 day ago

There's also shift+v to select whole lines.