Hacker News new | ask | show | jobs
by 102030485868 481 days ago
> My experience with modality is that almost every time I want to do something I'm in the wrong mode.

Vim tells you the mode though!

Insert -> Normal/Visual: ESC, Ctrl+c, or Ctrl+[. You could also do something like, while in Insert mode press Ctrl+o to do "one movement" (e.g. "i234[Ctrl+o]^1[Ctrl+c]", or maybe, "ihelo world[Ctrl+o]2Fll[Ctrl+o]$![Ctrl+c]" -- don't type the "[" and "]").

Normal -> Insert: well... it depends on where you want to insert.

> But in practice I can't count so I cut the wrong number of lines

Sometimes you don't need to keep track of the number of lines. But, if you really wanted to, you could do something like:

    :set relativenumber
If you're deleting 5 lines in, say, a CSV, this helps.

If it's code or text you could also use sentence ("(" and ")") or paragraph ("{" and "}") movements like "5d)" (delete the next 5 sentences); "d{" (delete up to the previous paragraph). There's a bit of jank when it comes to code though, but there's some support for it (or maybe I'm just doing it wrong).

> then I have to look up how to undo because obviously Ctrl+Z doesn't work

"u" for Undo, Ctrl+r for "redo". ":help undo" goes into _way_ more detail, and it does get complicated. I don't think I've needed anything past section 2.

> I just can't see where this "efficiency" is supposed to be at all.

The "efficiency" comes with investment, which you can get with any editor.

> If you tell me I'm supposed to spend 4 weeks reading VimTutor to gain efficiency in Vim

I didn't go through vimtutor for a very long time. You can become a reasonably okay Vim user, but it does take some investment. On the order of weeks is probably correct.

But honestly, VSCode is fine too. Notepad is... probably fine.