Live data from Hacker News

Learn Vim (the Smart Way): a book to learn the good parts of Vim

github.com

41–50 of 134 posts

Re: Learn Vim (the Smart Way): a book to learn the good parts of Vim

#41
post #37

Two things that helped me more than anything with "learning" vim and or ever wanting to use it: 1. Remap your "capslock" key to "escape." Vi was written using an ADM-3A terminal and its keyboard, which you can see here: https://catonmat.net/why-vim-uses-hjkl-as-arrow-keys has the escape-key in a sane place. On modern keyboards, if you can, remap "capslock" to "escape" when pressed alone, and "ctrl" when pressed with…

I think this is a bad idea because remapping keys has significant consequences with compatibility as you develop across more platforms. A good vi user is trying to build universal muscle memory, and making personal exceptions kinda ruins the efficacy of the editor. For example: I switch between dozens of computers, some are transient VMs or cloud instances, and I cannot afford the time (or simply cannot alter the sys…

I haven't done this completely (I use the jk remap hack in preference to escape) but I agree with this in general.

Emacs is an operating system, and vi is a language, which is widely "spoken". But if you invent your own dialect, you have an MxN problem, of getting M changes to register across the N programs which will listen to you when you speak to them in vi.

And I simply must nibble the bait in your last line: As a Mac native user, the command key, and consistency in commands across every native application, is one of the great features. It means, among other things, that Ctrl-whatever won't be intercepted when I send it to a program that uses it, or alternately, that it won't shadow the OS level affordance.

Back when I was spending five days a week inside a Linux VM, the context switch between Cmd-X and Ctrl-X for cut was pretty rapid and painless. Sure, I'd get the occasional cache miss, but that's harmless.

Re: Learn Vim (the Smart Way): a book to learn the good parts of Vim

#42
post #3

Ah Vim, one of the root causes of my imposter syndrome. (The others are CSS Grid, and Kubernetes)

Kubernetes very easy to use, worth learning imho. One hour's worth effort yields great advantage for work. Vim not worth learning to use as adult. Time too valuable. Takes too long to become extension of body. Best learned as child/teenager. Time worthless then. Maybe if you can learn it fast. Took me years of teenage to get unthinking proficiency.

Picked up my vi chops at 38.

The learning curve is admittedly steep, but you get past the curve pretty quick.

Re: Learn Vim (the Smart Way): a book to learn the good parts of Vim

#43

The best way to understand and use vim is to learn the "grammar" of vim and then practice using it until you have muscle memory for common movement and editing commands. This stackoverfow post explains how the vi/vim "grammar" works: https://stackoverflow.com/questions/1218390/what-is-your-mos... . A fun way to develop the muscle memory for the normal mode movement keys is to play Nethack ( https://www.nethack.org/ )…

Do you really? I've been using as my primary editor for last 10 years or so, I rarely make use of the grammar. I sounds fancy and powerful in theory but I don't end up using it that often (even though I'm aware of it).

That said I'm probably only an intermediate user, because I haven't put in the time to really make things like markers and macros part of my editing habits.

Re: Learn Vim (the Smart Way): a book to learn the good parts of Vim

#44
post #29

I know it sounds like a joke but any book on Vim should have have as its first lesson: how to quit Vim. That's the #1 question I get from vim beginners.

Lol, I made kind of learning material on Vim, and that's exactly what I do.

https://p1v0t.github.io/Doctor/

Re: Learn Vim (the Smart Way): a book to learn the good parts of Vim

#45
Buffers are one of the few parts of vim I never really got the hang of. Neither that nor windows are things I can ever remember how to do without fudging it the first time, having to go look up the manual again for how to do it properly, realize I'm wasting more time than I'm saving by trying to learn it, and give up.

Re: Learn Vim (the Smart Way): a book to learn the good parts of Vim

#46

Earlier quoted context omitted.

Kubernetes very easy to use, worth learning imho. One hour's worth effort yields great advantage for work. Vim not worth learning to use as adult. Time too valuable. Takes too long to become extension of body. Best learned as child/teenager. Time worthless then. Maybe if you can learn it fast. Took me years of teenage to get unthinking proficiency.

Picked up my vi chops at 38. The learning curve is admittedly steep, but you get past the curve pretty quick.

Ha, how about that. By the way, you might enjoy Lord of Light by Roger Zelazny. You're the hero of the story.

Re: Learn Vim (the Smart Way): a book to learn the good parts of Vim

#47
post #43

The best way to understand and use vim is to learn the "grammar" of vim and then practice using it until you have muscle memory for common movement and editing commands. This stackoverfow post explains how the vi/vim "grammar" works: https://stackoverflow.com/questions/1218390/what-is-your-mos... . A fun way to develop the muscle memory for the normal mode movement keys is to play Nethack ( https://www.nethack.org/ )…

Do you really? I've been using as my primary editor for last 10 years or so, I rarely make use of the grammar. I sounds fancy and powerful in theory but I don't end up using it that often (even though I'm aware of it). That said I'm probably only an intermediate user, because I haven't put in the time to really make things like markers and macros part of my editing habits.

That SO reply is a classic for a reason. If you don’t use the “grammar” you could be having a nicer time with your editor. Especially when editing code, being able, for instance, to pull out the contents of a pair of brackets, with or without the brackets, instantly, is quite convenient.

Re: Learn Vim (the Smart Way): a book to learn the good parts of Vim

#48
post #30

Two things that helped me more than anything with "learning" vim and or ever wanting to use it: 1. Remap your "capslock" key to "escape." Vi was written using an ADM-3A terminal and its keyboard, which you can see here: https://catonmat.net/why-vim-uses-hjkl-as-arrow-keys has the escape-key in a sane place. On modern keyboards, if you can, remap "capslock" to "escape" when pressed alone, and "ctrl" when pressed with…

Make your leader key something easy like the comma character "," I would do this but I use the comma and semicolon keys all the time. I find them so useful. Gosh vim is weird. Everyone uses it differently!

I guess you mean you use them to insert ,s and ;s. But the leader key would not be for insert mode, so you can choose anything convenient.

Re: Learn Vim (the Smart Way): a book to learn the good parts of Vim

#49
post #43

The best way to understand and use vim is to learn the "grammar" of vim and then practice using it until you have muscle memory for common movement and editing commands. This stackoverfow post explains how the vi/vim "grammar" works: https://stackoverflow.com/questions/1218390/what-is-your-mos... . A fun way to develop the muscle memory for the normal mode movement keys is to play Nethack ( https://www.nethack.org/ )…

Do you really? I've been using as my primary editor for last 10 years or so, I rarely make use of the grammar. I sounds fancy and powerful in theory but I don't end up using it that often (even though I'm aware of it). That said I'm probably only an intermediate user, because I haven't put in the time to really make things like markers and macros part of my editing habits.

Thats fine. The main thing is not to confuse technique with repertoire.. like a musical instrument, putting time in to mastering scales and finger technique will get you a lot of finesse in tackling musical pieces but it's the quality of your repertoire (in this context the algorithms/languages/higher problem solving knowledge) is what will be what gets you the money. Still a practising a few scales every now and then...

Re: Learn Vim (the Smart Way): a book to learn the good parts of Vim

#50
post #30

Earlier quoted context omitted.

Make your leader key something easy like the comma character "," I would do this but I use the comma and semicolon keys all the time. I find them so useful. Gosh vim is weird. Everyone uses it differently!

I guess you mean you use them to insert ,s and ;s. But the leader key would not be for insert mode, so you can choose anything convenient.

No, I use them with the f and F keys. They repeat the previous character search in forward and backward directions.
Post reply on HN