Re:The Efficiency of Vim
by koakuma-chan on Wednesday February 26, 2025 @10:29PM
(#43191019)
Nobody uses 5dd, you select what you want to delete in visual mode and then delete it.
[ Parent
| on HN ]
It's ok. Turn on relative line numbers and you'll see the light. :)
Re:The Efficiency of Vim
by koakuma-chan on Wednesday February 26, 2025 @10:37PM
(#43191068)
Relative numbers are overrated. Visual mode is much more flexible. Seeing absolute line numbers is useful for other purposes.
FWIW, I have a bind to toggle relative/absolute. You can have both!
Re:The Efficiency of Vim
by AlienRobot on Wednesday February 26, 2025 @10:32PM
(#43191036)
So if I want to erase one word to write another, instead of ctrl+delete or ctrl+backspace, I need to switch to visual model, delete the word, switch to insert mode, and type it?
Doesn't sound more efficient than VS code to me.
Re:The Efficiency of Vim
by koakuma-chan on Wednesday February 26, 2025 @10:38PM
(#43191076)
You need to press `ves` and type the new word. Trust me, it's really fast.
Re:The Efficiency of Vim
by flykespice on Wednesday February 26, 2025 @10:44PM
(#43191110)
'cw' is way faster, no need to enter visual mode (don't rely too much on it)
Re:The Efficiency of Vim
by cbm-vic-20 on Wednesday February 26, 2025 @10:52PM
(#43191165)
The power of the vi-family is that this generalizes consistently. Want to replace everything from here to the next comma? 'ct,TYPE STUFF HERE' I'm not a very accurate mouser, so with a GUI editor without sufficient vi-ness, that means I need to use the mouse to drag a selection, make sure I don't also grab the tiny comma, then start typing. So annoying.
Re:The Efficiency of Vim
by koakuma-chan on Wednesday February 26, 2025 @10:58PM
(#43191192)
I can't believe people actually use their mouse to select text.
> The power of the vi-family is that this generalizes consistently.
Absolutely! It takes learning relatively few command/motion combos before you are really cooking. The commands are fairly composable as well. I rarely find myself without being able to find a command that can't do what I want. To be fair it takes some time to learn all the commands but eventually you just forget about it and it becomes automatic.
Re:The Efficiency of Vim
by koakuma-chan on Wednesday February 26, 2025 @10:48PM
(#43191138)
Visual mode is way more practical because you don't always need to edit a word, you might need to edit a few words and/or things that are not words. I always use visual mode to see clearly what I'm changing.
Re:The Efficiency of Vim
by theonething on Wednesday February 26, 2025 @11:03PM
(#43191229)
Nope, you go to the word, do 'cw' (change word). That deletes the word under your cursor and automatically puts you in insert mode. Then you write your new word. I love it.
Or 'caw' if you want to change the whole word, even if cursor is in the middle somewhere. I read it as "change a word".
Re:The Efficiency of Vim
by theonething on Thursday February 27, 2025 @12:32AM
(#43191646)
hmm.. I've always used 'ciw'. What's the difference with 'caw'?