Live data from Hacker News

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

github.com

21–30 of 134 posts

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

#21

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'm personally a fan of remapping jk or jj to esc, there barely any instances in the english language where you would use those two letters together, and it means you can leave insert mode whilst barely moving your hands :D

My issue with this is that it causes a delay with every single j that is entered. Only a visual delay that freezes the cursor and then lets it jump by two characters, but irritating for me regardless.

Otherwise it's very practical though.

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

#22

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'm personally a fan of remapping jk or jj to esc, there barely any instances in the english language where you would use those two letters together, and it means you can leave insert mode whilst barely moving your hands :D

I tried mapping both jk and kj to Esc for a while (so I could just mash them in any order), but the slight delay it added to the letters always threw me off my loop.

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

#23
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.

I disagree, I learned Vim in my 40's after decades on emacs. For a month it was awful, but I have since recouped the time lost many times over. Other developers on my team went through the same.

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

#24

I started Vim when the internet went out once and, bored, I finally tried `vimtutor` on the debian command line. It just opens vim to a txt file that incrementally explains how to make basic edits. I was instantly hooked when I realized how much time "o" and "O" alone would save me over. I almost never use Vim these days because I was too lazy to port my .vimrc + Vundle plugins to a new laptop at some point, but I us…

My vimtutor experience was redoing it in the subway for a week. That got some muscle memory in :)

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

#25

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.

I disagree, I learned Vim in my 40's after decades on emacs. For a month it was awful, but I have since recouped the time lost many times over. Other developers on my team went through the same.

Very interesting. Good to hear.

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

#26
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/) with the number_pad option set to 0 so that hjkl are used for movement, the same basic keys for vi/vim normal mode (https://nethackwiki.com/wiki/Options#number_pad).

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

#27

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/ )…

Another fun game to play that focuses a bit more on vim itself: https://vim-adventures.com/

I definitely second playing nethack, whether you want to improve your vim skills or not.

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

#28
I partially learnt Vim some 20 years ago, but at some point stopped taking in new commands (possibly for lack of repetitive use), and am stuck in a sort of 'good enough' zone, but still awkward for certain things; the ctrl-c/v thing always throws me as I use windows primarily, gvim makes it easy to cheat using the GUI, so I do. Macros are amazing, but I feel there are probably easier ways of achieving most of the things I use them for (they, and regex search/replace are most if what I use Vim for outside of writing code).

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

#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!

Post reply on HN