Hacker News new | ask | show | jobs
by sstanfie 4508 days ago
Some thoughts on CAPSLOCK remapping:

After using vi / vim since 1986, I finally remapped CAPSLOCK to CTRL at the operating system level. It's made a world of difference, and not just for vi. It easily unlocks all the EMACS style cursor movements like ctrl+A, ctrl+E, etc.

Yeah, I know you can do it with the CTRL key in the lower left. But if you move from Mac laptop with Fn key in lower left, to an external keyboard with no Fn, you're gonna have a bad time.

But here's another reason why I advocate this approach. Remember vi was written by Bill Joy back in the 1970s. Back then, the early terminals had the control key right there next to the A. In fact, the CAPSLOCK was to the left of that!

I was recently at the Computer History Museum in Mountain View where you can see some of these early terminals. A lot of us know the Happy Hacker Keyboard, with the control key at it's rightful place. But to see it on the old terminals, it's a pretty good archeological insight into why it just feels right.

Plus, WHO USES THE CAPS LOCK KEY ANYWAY EXCEPT FOR SHOUTING IN FORUMS?

8 comments

I often use Caps Lock for acronyms, such as HTML, CSS, IntelliJ IDEA, and ad-hoc acronyms for book titles in notes. I do remap Caps Lock to Ctrl when I use Windows, because Windows requires Ctrl for many keyboard shortcuts, but I also make it so that Shift+CapsLock activates caps lock, so I can still use it.
Can you use Shift+Ctrl+ then?
> Plus, WHO USES THE CAPS LOCK KEY ANYWAY EXCEPT FOR SHOUTING IN FORUMS?

C identifiers like AUDCLNT_E_UNSUPPORTED_FORMAT.

Stuff like that is what various completion options are for. Ideally you only type crap like that out once, and for that typing with your left pinky on shift is sufficient for me.
Funny enough, I just installed a vim plugin that gives a mapping for converting variables between camelCase, snake_case, MixedCase, and UPPER_CASE. The plugin is vim-abolish by Tim Pope.

(This isn't really relevant to your post, just funny)

I use smart case autocompletion for this. Ctrl is just so useful, there are only a few reasons to use capslock (imo) and they're just not worth it.

    inoremap <C-x>c <esc>bgUWea
Type the identifier in lower case, and then <C-x>c(or whatever you feel like mapping it to).
OMG that is so cool. I just added it to my .vimrc.

Also, two high school juniors watching me try this also verified it's coolness.

Caps as control makes a lot of things very nice. Including hitting the "ctrl+[" which is the escape code for "esc".

So not only do you have easy access to keys like "ctrl+d" you also get escape.

I use a Happy Hacking Keyboard which does this remapping in HARDWARE and it is awesome for nearly everything! You never need Capslock, but Ctrl you use all the time and having it basically on the homerow feels great.
I also recommend capslock as both ctrl and esc. With combination of other keys, It works as ctrl. Otherwise it's just esc.

In linux, X11, xcape does it.

I swapped CTRL and ALT recently, and mapped CAPSLOCK to ALT. This puts CTRL under the thumb which helps reduce strain I think
I use CAPS LOCK as my compose key…
i write SQL in all caps...