Hacker News new | ask | show | jobs
by viraptor 4369 days ago
I don't really agree about "esc". "Normal mode" is the normal mode as the name indicates. That's where you normally start from. It's the actual writing that's two characters more (start insert mode, write, exit). Unless you're just writing new file from scratch in one go, you're likely to be in normal mode a lot of the time.

Also, shift is not needed for the beginning of the file. It's also "gg" for the first line / "G" for the last.

Regarding the ctrl+home/end, I much prefer not using them. Simply because I switch between 4 different keyboards during the week and I don't know where home/end are without looking. (3 of them being laptops with wildly different layouts) gg/G are on the home row. That's much easier.

2 comments

"It's the actual writing that's two characters more (start insert mode, write, exit)." Makes sense. Asking for permission to type in a text editor feels counter-intuitive, but I'll give that a try.
Vim really is an editor: It's designed around changing existing text. Inserting new text is just one of the actions you can perform, and you can combine that action with other modifiers, like "5ifoo<esc>" results in foofoofoofoofoo -- 5 repetitions of "insert foo"
This goes better when you know (and have internalized) more of the paths into insert mode.

For instance, ci} will delete everything inside the tightest enclosing braces and switch you to insert mode. This whole thing, then, including what you type, is a single action that you can redo with .

What's ^Home / ^End? If it's moving to the beginning / end of a line there are vi shortcuts for that: ^ and $.