Live data from Hacker News

Vim: Spacebar as leader key, CapsLock as Esc

karmanebula.com

11–20 of 44 posts

Re: Vim: Spacebar as leader key, CapsLock as Esc

#11

If I am going to have to relearn where some of the keys are in vim then I might as well go the whole hog and get a Dvorak keyboard whilst I am at it!

lol - well, it's just an option. Certainly less invasive than changing the keyboard layout, but I understand the muscle memory element of it.

I definitely stuck with the default vim bindings (and for the most part can switch back to them quickly) until I wanted to customize the experience to my preferences. There's definitely something to be said about keeping the stock bindings unchanged, if that's one's preference.

Re: Vim: Spacebar as leader key, CapsLock as Esc

#12
post #6

I use as my Easymotion leader.. https://github.com/Lokaltog/vim-easymotion it's well worth a look, gives you super quick fine grained movement similarly inoremap jj to take you from INSERT mode to NORMAL mode is nice

I like the jj trick as well.

Re: Vim: Spacebar as leader key, CapsLock as Esc

#15
post #6

I use as my Easymotion leader.. https://github.com/Lokaltog/vim-easymotion it's well worth a look, gives you super quick fine grained movement similarly inoremap jj to take you from INSERT mode to NORMAL mode is nice

I've been using

    inoremap jk 
for a long time now, and it works like a charm.

Re: Vim: Spacebar as leader key, CapsLock as Esc

#16
I use CapsLock as escape but had I not gotten so used to that by now I would probably have used it for control instead and mapped escape to jk or something. I, like many people, use `,` for my and with Clever-F[0] I don't lose the original functionality which is just remapped to consecutive presses of 'f'.

[0]: https://github.com/rhysd/clever-f.vim

Re: Vim: Spacebar as leader key, CapsLock as Esc

#17
Perhaps I have spent so much time on Mac that pressing the Ctrl key for things feels unnatural vs. the Command key

Argh. OS X is the last significant platform that gets this right by not trying to use Control for menu shortcuts out of the box. When I'm in a terminal, or editor, or browser text box, it's perfectly common and reasonable to want to distinguish Control-V (literal) from Command-V (paste), Control-Z (suspend) from Command-Z (undo), and so on.

Pre-Linux X Window software typically managed this, using Meta or some other keysym for GUI operations, but current ‘desktops’ seem dead set on imitating MS Windows. Damn kids get off my screen.

Re: Vim: Spacebar as leader key, CapsLock as Esc

#18
I basically do this, but I use "," (comma) as my leader, and I make capslock do double duty as ctrl and esc using KeyRemap4MacBook (https://pqrs.org/macosx/keyremap4macbook/). The trick is first remap capslock to Ctrl in keyboard system preferences, then use KR4MB to remap Control_L (the left control key, which is to say, what capslock now signals) to Control_L, but if you type ONLY Ctrl_L it sends esc. so when i need escape, it sends that. when i want to use it for Ctrl-modified combos, it does that. Works fantastically for Vim, i've been doing this for a couple years now. Also nice for emacs keyboard shortcuts in other apps that respond to them.

Re: Vim: Spacebar as leader key, CapsLock as Esc

#19
post #14

Love spacebar as the leader key, but not a fan of CapsLock as Esc. CapsLock as Ctrl is better. For one, you never have to stretch for the real Ctrl, and two, you can use it for escape as well: Ctrl-[

You know, I've heard a lot of people go this route, and they like it a lot.

I tried it for a couple of days, maybe not long enough, and I guess a lot of this comes down to feel, which comes down to previous typing experience and personal preference, which seems that it may be highly personal (though I don't have data to back that up).

Re: Vim: Spacebar as leader key, CapsLock as Esc

#20

I basically do this, but I use "," (comma) as my leader, and I make capslock do double duty as ctrl and esc using KeyRemap4MacBook ( https://pqrs.org/macosx/keyremap4macbook/ ). The trick is first remap capslock to Ctrl in keyboard system preferences, then use KR4MB to remap Control_L (the left control key, which is to say, what capslock now signals) to Control_L, but if you type ONLY Ctrl_L it sends esc. so when i n…

I also use KR4MB, but I found that I'm migrating toward a multi-system (more than one keyboard on more than one OS) situation. This introduced some peculiarities to my workflow where it means I can't rely on KR4MB always being available. I originally thought I might use KR4MB a lot more, but I've had to minimize its use to get that cross-platform consistency in my particular case.
Post reply on HN