Live data from Hacker News

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

github.com

81–90 of 134 posts

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

#81

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…

Die hard vimeleon here. IMHO chording the 'j' and 'k' keys simultaneously [1] is a severely underutilized solution for escape. Try it. You'll love it. If you're going to rebind capslock to something — and this is particularly true if you're on macOS — rebind it to backspace. Capslock escape isn't useful outside of Vim. Backspace is useful everywhere, including inside Vim. [1] https://github.com/kana/vim-arpeggio

> 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

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

#82
post #3

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

Add real-time safety critical systems, realistic 3D rendering, reverse engineering, quines, Paxos, deep learning, production-quality Haskell, and Boston Dynamics.

Quines almost always have exactly the same structure:

- Header (code)

- Data blob (string variable) that encodes the header and footer

- Footer (code)

Since the data blob is a variable, the header/footer simply decode the data blob and write out the decoded header, original blob, and decoded footer.

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

#83

Earlier quoted context omitted.

Die hard vimeleon here. IMHO chording the 'j' and 'k' keys simultaneously [1] is a severely underutilized solution for escape. Try it. You'll love it. If you're going to rebind capslock to something — and this is particularly true if you're on macOS — rebind it to backspace. Capslock escape isn't useful outside of Vim. Backspace is useful everywhere, including inside Vim. [1] https://github.com/kana/vim-arpeggio

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

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

#84

Earlier quoted context omitted.

Die hard vimeleon here. IMHO chording the 'j' and 'k' keys simultaneously [1] is a severely underutilized solution for escape. Try it. You'll love it. If you're going to rebind capslock to something — and this is particularly true if you're on macOS — rebind it to backspace. Capslock escape isn't useful outside of Vim. Backspace is useful everywhere, including inside Vim. [1] https://github.com/kana/vim-arpeggio

> 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

I use option-e e to insert é, option-n n to insert ñ, etc. I noticed this while pressing option in the Keyboard Viewer.

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

#85

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…

> Remap your "capslock" key to "escape." I hear this recommendation a lot. You can do that, but much better is to get a keyboard with a proper thumb cluster like a kinesis[1], maltron[2], dactyl[3], ... Much better to put such a common key on the thumb than stress out a pinky. I have a kinesis, and have esc mapped to the 'end' key there; similar positioning is possible on other keyboards. The keyboards I linked are a…

Several years ago I finally developed RSI. It took nearly a year of different setups and exercises to figure out what would work. The cause of RSI for me was a well known ergo keyboard. I had been using it for nearly a year before the pain/numbness started in my hands. I went back to standard slab keyboards, and every time I use a ergo keyboard the issues flare up again.

So, while I like the style of those keyboards, I can't justify spending that much if I am likely to develop RSI again.

---

I'm one of those weirdo's that has remapped caps to Lctrl/esc, tab to hyper/tab, \| to alt/\|, return to Rctl/enter. It's comfortable. (Ralt is now Compose/Dead Greek and Rctrl is Caps Lock)

I would love more buttons to the left of the keyboard. I currently use a 10-keyless but would love a cluster of 10-15 keys to the left of my left hand. and possibly 6 keys under the thumb area. And a real dedicated hyper key. Maybe another row of F-Keys too...

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

#86

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 thi…

You get over it if you use it enough. For me its now the opposite. For a while I keep accidentally trying to do Ctrl+C/Ctrl+V, but now I find myself trying to go into Visual mode or Normal mode in programs that dont support that.

I started off with a bunch of mappings, then you can remove them as you get comfortable. Now I only really have mapped "nmap H :nohlsearch" and "xmap S :sort".

Whats really tricky is using Vim without the Arrow keys. Normally I am on a desktop so it doesnt matter, but when I use a laptop it makes more sense to use HJKL. Again its just something that you need to force yourself to do or you wont get comfortable with it.

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

#87

Earlier quoted context omitted.

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…

On Linux and Mac it’s possible to have caps be escape when pressed alone or control when pressed with another key. On Linux the software is called xcape. :)

On Mac, there is Karabiner-Elements.

https://karabiner-elements.pqrs.org/

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

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

Sure, I use VSCode and Intellij and all the beautiful modern IDEs. But I use them with Vim keybindings turned on. Because extremely common things that you do while programming are extremely quick for me to do with vim commands.

ci" == delete everything within these quotes, and put me in insert mode. vi{:%s/old_var_name/new_var_name/g == rename a variable within a block qaI"A",jq == make a new macro to quote a line of text and add a comma at the end. Great for taking a bunch of strings I've copied from a text file and putting them into a list in code. But the point here is not this specific macro; I can do all sorts of minor text processing macros for the dumb thing I have to do, and not manually process 100 lines of text to turn it into a piece of json.

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

#90

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…

[deleted]
Post reply on HN