Live data from Hacker News

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

github.com

91–100 of 134 posts

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

#91

Earlier quoted context omitted.

> If you're going to rebind capslock to something — and this is particularly true if you're on macOS — rebind it to backspace. No, rebind it to Compose. Makes life a lot easier. https://en.wikipedia.org/wiki/Compose_key

That's interesting. I'm a bit spoiled by primarily using Vim to write code and prosé in American English. Vim's digraph feature (Ctrl-K by default) has handled unicode char input nicely enough for me, but I wonder if the compose key could be of use when writing text in Japanese for example.

I actually meant to do it systemwide, for when you're writing or googling things not in English, or when you want to write a fancy ⅝. The day I have to start putting diacritics into computer code is the day I quit programming:)

I think it's no good for Japanese, but I know very little about Japanese input. Romanji is still Japanese, right?

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

#92
post #55

I'm not trying to be contrarian here, but why would someone continue to use Vim and Emacs when all of its lovely features have been integrated into products like VCode? It just reminds me of serious men with beards working on mainframes and AIX power systems when I started my career.

Can I make a TODO link to a piece of code and have VSCode email it to me periodically? When viewing a particular function, can I have a link to the actual email discussing this feature in a comment, and have VSCode open up the relevant email?

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

#93

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 like kk.

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

#94
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…

You should absolutely personalize tools you use extensively. Vim if your a writer or programmer.

It’s very little to cp .vimrc. I do a lot more, have dotfiles git repo scripted to self install.

But yes transient vms are problem. But I’m willing to suffer a little on them to have 20x more enjoyable and productive were I do 90% of my writing.

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

#95

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

The first thing I put in my .vimrc on any system:

  inoremap jk 
I learned it through Spacemacs and it's one of the things that really made modal editing work for me, so I was thrilled to discover that Vim itself also supports it. (I'd tried to learn Vim before, but always having to jump over to the Escape key was a huge downer for me, and coming from Emacs I'd already mapped my CapsLock to Ctrl--though the idea of having it be Esc if pressed by itself is intriguing and I need to look into it more!)

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

#96
post #38

Earlier quoted context omitted.

the biggest problem is you buy the game for $25 and it only lasts 6 months, that seems a bit crap, doesn't really make sense to me to sell it as a limited time license, which is why I never bought it. But then I'm not exactly the target audience, I already know Vim, but I did enjoy the intro levels when I tried it a while back.

That's true but most people would pay that once or twice, which puts potentially small beans if it increases your productivity. Plus it's fun

I dunno, I don't buy things when I don't think the pricing is fair, regardless of whether I can afford it, as a gamer, $25 gets you a lot of good games that you keep forever. This one, you don't keep, to me it just doesn't feel right. I'm sure others feel differently, but, just putting it out there why I chose not to buy it where otherwise I would have.

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

#97

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…

When I was first learning Vim I remapped caps lock to escape, and it was a huge improvement. But as I became more comfortable in Vim I realized I was using the control key a lot. I've since remapped caps lock to control, and use ctrl-[ as escape (this is default behavior). I find having an easily accesible control key is very useful, even outside Vim. You can see in your link that it is actually the control key that…

This is what I do on both Linux and macOS. I like remapping Caps Lock to Ctrl/Command because it's the UNIX-style key layout I'm used to on the old IBM Model M keyboards, and my left and right pinky fingers are used to the Ctrl-[ combination, it's burned into muscle memory.

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

#98
post #37

Earlier quoted context omitted.

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…

You should absolutely personalize tools you use extensively. Vim if your a writer or programmer. It’s very little to cp .vimrc. I do a lot more, have dotfiles git repo scripted to self install. But yes transient vms are problem. But I’m willing to suffer a little on them to have 20x more enjoyable and productive were I do 90% of my writing.

The first thing I do on a new machine is clone my dotfiles from Github. It's fast enough for an action that increases my productivity exponentially and I'll end up saving back that time it took to clone very quickly. I don't switch machines that often anyway.

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

#99

Earlier quoted context omitted.

I recently learned this trick since getting a new MacBook pro with the touch bar esc key. I couldn't stand the lack of travel and didn't want to remap keys, now I use the ctrl-[ combo on all keyboards out of habit

Relevant to the other conversations going on in this thread, how simple is it to re-map that ctrl-[ to work globally? I'm assuming I'd have to install something for this. I am also using a Mac and use the caps-lock-as-escape to, say, close my spotlight search bar after activating it using the command+space shortcut.

In theory at least Ctrl-[ "is" Escape and is already universal. Reason: simultaneously pressing Ctrl is the ASCII -> ASCII mathematical transformation "subtract 0x40" for keys that represent a single ASCII character. So for example Ctrl-M is 0x4d - 0x40 = 0x0a. M is 0x4d ASCII and carriage return (aka '\r', aka Enter) is 0x0d ASCII. Ctrl-M is, or at least should be, universally the same as Enter. Similarly '[' is 0x5b in ASCII, so Ctrl-'[' is 0x1b in ASCII which is the ASCII code for, you guessed it I hope, Escape. Phew that was tough on a phone.

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

#100

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…

When I was first learning Vim I remapped caps lock to escape, and it was a huge improvement. But as I became more comfortable in Vim I realized I was using the control key a lot. I've since remapped caps lock to control, and use ctrl-[ as escape (this is default behavior). I find having an easily accesible control key is very useful, even outside Vim. You can see in your link that it is actually the control key that…

I remap my right Alt to Ctrl. The best thing I have ever done with regards to ergonomics. It works wonders in all softwares, not only vim. It's much more convenient to press with the thumb than CapsLock is with the pinkie.
Post reply on HN