Live data from Hacker News

Vim: Spacebar as leader key, CapsLock as Esc

karmanebula.com

21–30 of 44 posts

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

#21
post #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 (suspe…

I think this is one of the main reasons I went with space in this case. Hitting a shortcut starting with a key that either thumb can reach felt more like the Command key, which is part of why I like it. It seems that my thumb is more nimble (and has a much higher range of motion) than my pinky.

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

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

jj is great, I also use ; as : to save a key press on a very common command

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

#24
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-[

I do the same, and caps lock as control works great. After speaking with a colleague of mine who has worked with Unix from way back before my time, I learned to do this. This was actually where the control key was on old keyboards -- http://i.imgur.com/MyL0F8q.jpg

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

#25
I prefer remapping capslock to control for easier use of commands like , , , , and (all of which were absent in the example vimrc posted). Using the leader key makes total sense for dealing with splits and buffers or plugins you might want to look into some of the other Control based commands that Vim supports.

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

#26
post #2

What is a leader key? How much typing class did I miss?!

I think he means instead of using a colon to begin Vim commands, he begins by typing a space. I started using Caps Lock as an extra Ctrl a couple months ago. It's great, except now I can't use other people's computers because I end up in caps-lock shout mode. E.g. instead of "ctrl+l" in my browser to visit a site, it ends up: CTRL+SHOUT+L BROWSER TAKE ME TO FACEBOOK I COMMAND THEE

Leader is actually a different key than the colon in Vim. Here's a nice description of it: http://learnvimscriptthehardway.stevelosh.com/chapters/06.ht...

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

#29

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…

This is what I do too: Caps Lock sends either Escape (when pressed alone) or Control (with something else). I cribbed it from Steve Losh: http://stevelosh.com/blog/2012/10/a-modern-space-cadet/.

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

#30
post #25

I prefer remapping capslock to control for easier use of commands like , , , , and (all of which were absent in the example vimrc posted). Using the leader key makes total sense for dealing with splits and buffers or plugins you might want to look into some of the other Control based commands that Vim supports.

I use Ctrl-f and Ctrl-b (as well as Ctrl-e and Ctrl-y) pretty often, and you're right that there are no shortcuts for it in the provided example. Perhaps I should look into those as possible next targets. I guess I'm not entirely eliminating the Ctrl key from my vim usage (not that there's anything wrong with Ctrl, really), but you have a point.

I'm guessing I use Ctrl-e more often than :e - perhaps I should change that up.

There seems to be a lot of ringing endorsements for CapsLock as Ctrl in the comments.

Post reply on HN