
A useful Caps Lock key - rbcoffee
http://brettterpstra.com/2012/12/08/a-useful-caps-lock-key/
======
pak
I remapped my Caps Lock key to switch into a "Greek" mode for typing, since I
frequently need to type Greek letters interspersed with English. (Anybody in
STEM classes should know how awkward it is to do this normally.) If you have a
Mac, you can do this with Ukelele, a free key remapping tool. You can even set
up and add "dead key" modes (e.g. the way opt+E allows you to add a diacritic
to the next letter typed). There are some really advanced configurations
possible. Ukelele even still works on Mavericks.

[http://scripts.sil.org/cms/scripts/page.php?site_id=nrsi&id=...](http://scripts.sil.org/cms/scripts/page.php?site_id=nrsi&id=ukelele)

~~~
snotrockets
Not awkward, just with a little steep learning curve. The only way to type
math notation (which isn't the same character set as Greek. Compare
\varepsilon with \epsilon, for example:
[http://www.w3.org/2003/entities/2007doc/#epsilon](http://www.w3.org/2003/entities/2007doc/#epsilon))
is LaTeX. And for that, the only keys you really need are the dollar sign and
backwards-slash.

~~~
winterswift
> The only way to type math notation is LaTeX.

No it isn't. Perhaps by far the best and most practical way, but not the _only
way ever_ to type math notation.

~~~
snotrockets
Try to write anything math heavy that is longer than a couple of pages in any
other tool.

I'd be finishing typing a small monograph by then. LaTeX is far from perfect,
but there isn't a better solution yet.

------
septerr
I think macs make working with keyboard shortcuts very difficult for various
reasons. \- Command and Control are confusingly named. \- They use most of the
function keys for windows related things - bring all windows to front etc. \-
There is no key for right click like those offered by Windows keyboards to
bring up context menus. \- You can Command-Tab to an application but not to
the individual windows of that application. You must use Command-Tilde for
that. \- Apps offered for mac don't have a consistent behavior for the close
button. Some apps will close the window, but stay in the dock. Others will
quit. \- On Windows, if the first letter in the menu bar items is underlined,
you can be sure you can just do Alt + that letter to open up that menu item.
You could even move windows using one of the menu item options and arrow keys.

My biggest issue on switching from Windows to Mac was losing all those
keyboard shortcuts. On Windows I could do a whole lot more without ever
touching the mouse.

I know you can remap your keys etc. but then you usually end up acting all
awkward anytime you have to use someone else's computer. So I want the
defaults to be good instead and I think Windows got theirs better than Mac.

Don't hate on me for this. I know both operating systems have their pros and
cons.

~~~
ajanuary
Windows is just as inconsistent with closing, with the added bonus of also
being inconsistent with minimizing behaviour too. How do you get an app to go
to the systray? Close it? Minimise it? Who knows.

While I do agree Windows has a better keyboard story, most of what you
describe are just differences, not worse.

~~~
SEMW
Alt-space gives the window menu.

Close: alt-space, c

Minimise: alt-space, n

Maximise: alt-space, x

etc.

Works in every version of windows since 95ish, as well as every popular Linux
DE I've ever tried (inc. gnome, xfce, kde, cinnamon).

------
jes5199
I've got it mapped to Control like a standard hacker,

but this reminds me that some years ago I had it mapped so that if I hit
SHIFT-CAPSLOCK (which is a rather unusual thing to do, think about it), it
would type... a tilde. I have no idea why I thought I wanted that.

~~~
socksy
Are you sure it was a tilde? My terminal emulator puts in tildes for various
special characters (such as when I press the delete key).

------
GhotiFish
Compose key!
[https://en.wikipedia.org/wiki/Compose_key](https://en.wikipedia.org/wiki/Compose_key)

languages, like ruby, haskell, and go, let you use unicode characaters in the
language. You can map those characters to key combinations with the compose
key.

It comes with a giant list of key combos for accented characters too. So it's
worth enabling, then defining your own combos for symbols you'd like to add to
your vernacular.

~~~
rurounijones
The first ruby code I find with unicode characters outside the comments gets
the author a smack around the head :)

Yes it is all very nice that you can do this, but if you publish some code
which some poor shmuck wants to modify on his non-uber-unicoded-dev-setup you
just made his life a lot worse.

~~~
AlecSchueler
Who is using an editor that doesn't support Unicode?

~~~
Danieru
That was what I thought until my patch broke the build for a windows based
dev. Granted this was C++, Ruby should fair better by having a single popular
runtime.

------
josegonzalez
I use caps-lock instead of shift. For example, I do "CAP-LOCK, LETTER, CAPS-
LOCK" to type a capital letter. It's less efficient, yes, but it works just
fine for me. Explaining this to anyone gets "you're kidding" views, but I
assure you, the caps lock key is already quite useful to me.

~~~
drifkin
It's actually unclear whether it's less efficient or not. Sean Wrona, one of
the fastest typists in various competitions, generally uses it in place of
shift.

He posts about it here:
[http://forum.colemak.com/viewtopic.php?pid=8851#p8851](http://forum.colemak.com/viewtopic.php?pid=8851#p8851)

~~~
userbinator
The first thing to come to mind when I read the parent was Sean Wrona too...

I use StickyKeys which lets me hit Shift and then a letter, which I think is
even faster since you don't have to "un-shift" like you would with CapsLock.

------
jrockway
Isn't hyper its own key, not a combination of the other modifiers?

[http://upload.wikimedia.org/wikipedia/commons/4/47/Space-
cad...](http://upload.wikimedia.org/wikipedia/commons/4/47/Space-cadet.jpg)

Emacs seems to think so:

    
    
      ELISP> (kbd "S-s-C-M-x")
      [176160792]
      ELISP> (kbd "s-C-M-x")
      [142606360]
      ELISP> (kbd "H-x")
      [16777336]

~~~
drifkin
Yup, it's its own key. People tend to refer to this combination of modifiers
on OS X as "Hyper" because of this post by Steve Losh:

[http://stevelosh.com/blog/2012/10/a-modern-space-
cadet/#hype...](http://stevelosh.com/blog/2012/10/a-modern-space-cadet/#hyper)

~~~
jrockway
That's annoying. How do Mac users use capitalized Greek letters as part of key
combinations!?

~~~
chipotle_coyote
It's a horrible burden, but we've learned to make do.

------
mattengi
In linux, if you want to make Capslock as both ESC and Ctrl,

    
    
        $ setxkboption -option -option 'ctrl:nocaps'
        $ xcape
    

[https://github.com/alols/xcape](https://github.com/alols/xcape)

What is good for?

    
    
      - Happy with vim
      - Happy with emacs like - readline - keybinding. C-a, C-e, C-u, C-k, C-d, C-h, C-w, C-p, C-n, C-y ...
      - Ctrl key is most used in any gui application.
    

You can abandon both bottomleft Ctrl and topleft Esc.

~~~
StavrosK
How does that work? Pressing it alone is escape, pressing it in combination
with another key is Ctrl?

~~~
mattengi
Yes

------
myhf
I just remap caps lock to act as a random modifier each time it's pressed. It
seems absurd to set it up any other way.

------
braydenm
Caps is a fantastic key to use for things like backspace, but if you want even
more functionality, try using it with Colemak as a modifier that puts all the
other common keys right on your home row:
[http://forum.colemak.com/viewtopic.php?id=1467](http://forum.colemak.com/viewtopic.php?id=1467)

~~~
reeses
Slap that on a Truly Ergonomic keyboard
([https://www.trulyergonomic.com](https://www.trulyergonomic.com)) and you're
living my life. Do it all at once and type 4 wpm for a month.

(I have the older "international" version with a number of blank keys. I
remapped the left space bar to command and the lower left dead key to hyper.
Tapping either shift of course generates a paren.)

------
sirsar
If you're on Windows, a no-hassle way to do this is with AutoHotkey.

[http://www.autohotkey.com/](http://www.autohotkey.com/)

[http://www.autohotkey.com/docs/misc/Remap.htm](http://www.autohotkey.com/docs/misc/Remap.htm)

------
kozikow
It may be useful to remap right shift to shift/delete in similar manner. Also
look how awkwardly placed ctrl is. You can remap enter to act as ctrl if it is
pressed with something (and plain old enter otherwise). I did this in my
keyboard layout: [https://kozikow.wordpress.com/2013/11/15/the-only-
alternativ...](https://kozikow.wordpress.com/2013/11/15/the-only-alternative-
keyboard-layout-youll-ever-need-as-a-programmer/) .

------
lukifer
This is a great trick, and absolutely worth doing. I have mine mapped to Hyper
as well, which is tied to Slate bindings for resizing and managing windows.

[https://github.com/jigish/slate](https://github.com/jigish/slate)

~~~
djfergus
Care to post your slate configuration file? I've just started using it and am
seeking inspiration.

~~~
craigmccaskill
[https://github.com/lunixbochs/reslate](https://github.com/lunixbochs/reslate)

Was built by a co-worker of mine (ontop of slate). Pretty great set of
defaults.

~~~
n0nick
+1 for reslate :)

I use it combined with a hyper key mapping (similar to OP) and enjoy it very
much.

my config file:
[https://github.com/n0nick/dotfiles/blob/master/slate/slate.j...](https://github.com/n0nick/dotfiles/blob/master/slate/slate.js)

------
broodbucket
I just disable its functionality and use it as an extra key for things such as
push to talk. Getting in the hang of using as a replacement for delete/escape
etc causes muscle memory problems when typing on someone else's keyboard, if
you're only ever using your own then it's beneficial, kinda like switching
from qwerty

------
belluchan
I learned to type in a keyboarding class in high school in the nineties. I was
taught to use the caps lock automatically for instances where there are 3 or
more capital letters. I cannot give that up as infrequently as it happens.
That is much more inconvenient to me than making that key do something else.

------
robomartin
There's history to support the Ctrl key being to the left of caps-lock.

[http://www.redgrittybrick.org/terminals/keyboards.html](http://www.redgrittybrick.org/terminals/keyboards.html)

I guess without another key to the left a lot of people remap caps-lock to
ctrl. I never got used to that for some reason. In general terms I tend to
avoid remapping in order to maintain a consistent UI. the only exception to
this that makes sense to me is that all of my Macs have always had their
keyboards remapped to match a PC. As closely as reasonable and possible. For
example, ctrl-c and ctrl-v do exactly the same thing whether I am running a
Windows, Linux (GUI) or MacOS machine.

------
kybernetikos
Reminds me of the Caps Lock Function key on the Acorn Electron computers. Most
keywords in the version of BASIC that came with the computer had a
corresponding key, so if you were writing a program, you'd simply hit
CapsLckFn-P for PRINT or CapsLckFn-E for ELSE etc.

It worked surprisingly well for coding.

If you look carefully, you can see the keywords printed on the front of the
keys.

[http://ewyse.files.wordpress.com/2011/03/acornelectron_top.j...](http://ewyse.files.wordpress.com/2011/03/acornelectron_top.jpeg)

~~~
adestefan
Cool keyboard. It's also interesting since you assumed, and all of us would
have, P would be PRINT, but it's actually PLOT. PRINT is on the /.

~~~
drivers99
In a lot of old BASICs you can type "?" instead of "PRINT" [1]. I bet that's
why they put PRINT on that key. Just an observation.

[1] for example:
[http://www.antonis.de/qbebooks/gwbasman/print.html](http://www.antonis.de/qbebooks/gwbasman/print.html)

------
drifkin
I ended up doing something very similar after reading Steve Losh's article. I
kept Control where it was, using Caps Lock as Escape/Hyper . The best part by
far is using Caps Lock + hjkl for navigation. At work, I leave my arrow keys &
numpad covered up with a mouse platform so I can keep the mouse closer.

A side effect of this was feeling completely lost when using Windows in Boot
Camp. I found that there's a great piece of software on Windows called
"AutoHotKey" that lets me do the same hjkl navigation.

~~~
TacticalCoder
caps lock + hjkl requires your left pinky every time you want to move the
cursor. This may very well induce RSI because "using the arrow keys" is
something that we tend to do all the time.

I'm using the key physically at the left of the space bar (I don't like
talking about the 'name' of the key because it's very keyboard-dependent) as
the modifier which allows me to move the cursor. And I move the cursor using
modifier+ijkl (for ijkl reproduces the inverted T arrow cluster, not unlike
how gamers like to use WASD or ESDF). I do hit the modifier using my left
thumb, which is a finger much stronger than the pinky (and, arguably, such a
setup is less RSI inducing).

Regarding covering the arrow keys and numpad with a mouse platform: many
people opt for for a "TKL" (no numpad) or even 60% keyboard (no numpad, no
arrow cluster) and typically those 60% keyboards have the benefit of coming
with quality switches (also arguably less RSI inducing).

If you want to see what others are doing, two great sites are geekhack.org and
deskthority.net.

FWIW I use a 60% keyboard which has CTRL at the correct place (i.e. where
CAPS-LOCK is on keyboards which have a caps-lock): an HHKB Pro 2 (using the
amazing Topre switches)... Which doesn't even have a CAPS-LOCK key.

Note that lately there seem to be a regain in interest in alternate setups and
alternate mappings: for example the "SpaceFN" layout uses the space bar as an
additional modifier (when it is held down) and ijkl to move the cursor around
(once again: ijkl and not vim's hjkl and a strong finger, the thumb, to press
the modifier).

Regarding remapping and "feeling completely lost" on other OSes: if you want
to not have to remap your keyboard on Windows / OS X / Linux etc. you may want
to buy a keyboard which has a programmable controller: your setup then works
the way you want on any computer.

~~~
drifkin
Thanks for the info. I actually went through a whole mechanical keyboard phase
myself and went through several keyboards without numpads. I spent months
using these keyboards, but in the end I found I was fastest and most
comfortable typing on an Apple wired keyboard (heresy, I know). I much prefer
the footprint of the Apple wireless keyboard, but I find that even though it
seems like it'd be identical to the wired version, the keys aren't nearly as
solid.

I am kind of curious about Topre switches, I haven't tried them yet. Only
various Cherry switches.

I think the pinky RSI issue isn't so bad for me because most of the time I'm
in a text editor with vi keybindings, so I wouldn't be using the arrow keys
anyway. It's just nice in other apps to have that ability. In the situations
where I do use my pinky, it's typically when I'm not typing very much, so I
actually just move my left hand so my pinky rests over the Caps Lock key and
doesn't need to move laterally. It's some movement, but still less than
reaching over to the arrow keys.

------
jamesjporter
Us Emacs users unfortunately have to remap it to control to retain sanity on
standard keyboards :P

~~~
chipotle_coyote
I do that by default now, too -- OS X has a few basic Emacs control keys that
work in all text fields/boxes, like ^P/^N, ^A/^E, ^D, etc., and even though I
rarely use Emacs itself those have become muscle memory.

(I use KeyRemap4MacBook for a couple things, including mapping Caps Lock to
pressing both shift keys simultaneously, so I still have it if I need it.)

------
dunham
I cut my teeth on Sun keyboards and emacs, so I always remap caps lock to
control.

------
mFixman
As a Spanish speaker who's used to using English keys for programming, I found
it useful to use the Caps Lock key to change keyboard layouts.

~~~
falsedan
I prefer Scroll Lock for cycling keyboard layouts

------
ozh
On fr_FR mapped keyboards (AZERTY) the upper left key is a utterly useless ².
I've remapped it to a backtick ` which is otherwise complicated to obtain
(needs a 3 key combo). If anyone interested:
[http://planetozh.com/projects/azertyck/](http://planetozh.com/projects/azertyck/)

------
dokem
Remapping my capslock key to escape was the only way that I could finally
switch to Vim. Highly Recommended.

~~~
InclinedPlane

        inoremap jj <Esc>
    

Best .vimrc setting ever.

~~~
scintill76
Have you compared it to CapsLock as ESC? I understand Escape is in a
ridiculous position on most keyboards, but I think CapsLock makes a great mode
switcher, and have been using it for a few months now. (Downside being that it
can't be done in vimrc, at least not in terminal vim which I use.)

The jj and jk hacks always seemed ridiculous, but maybe I'll give them a try.
I think I would prefer jk for speed and fatigue reduction, or maybe even
something on the left home row since I'm left-handed.

~~~
InclinedPlane
As you say, you can't just tweak the capslock assignment in vimrc or by
issuing a command. The great thing about the jj/jk hack is that if you end up
on some random system or borrowing someone else's shell for a second then all
you have to do is type ":inoremap jj <Esc>" and you're back in the groove.

I was a little skeptical about it at first as it seemed like a weird hack, but
it's actually quite practical. The fact that you don't have to leave the home
row to swap between modes is a huge efficiency boost.

------
thedookmaster
I have Caps Lock mapped to Backspace. Makes total sense after seeing how out
of the way Backspace is.

------
skryl
If you're looking for the rest of the private.xml file (HYPER + H/J/K/L)
mappings...

[https://gist.github.com/skryl/8143550](https://gist.github.com/skryl/8143550)

------
daGrevis
I have been using super-caps for some time to remap Caps to be Escape __or
Control __if pressed together with something
else.[https://github.com/cmatheson/super-
caps](https://github.com/cmatheson/super-caps)

I must admit, on my computer I'm super productive. My left hand isn't moving
at all and my left's pinkie feels relieved because it doesn't have to bend to
Control key. On other computers I'm totally screwed. As OP mentioned before, I
have ruined my muscle memory.

------
dima55
Does nobody use the Caps Lock key as a caps lock? Pretty useful for that.

~~~
clarry
If someone's editor has got a convenient way to capitalize parts after they've
been written, I'd be interested in knowing how it works. You can invert case
with ~ in vi, but it's not so great for #defines and such (you capitalize
every letter in these, and ~ works on a letter at a time).

~~~
rbonvall
Vim provides operators for changing case: gu for lower case, gU for upper case
and g~ for swapping case.

For example, gUaw changes the current word to upper case. guu changes the
whole current line to lower case.

In visual mode, you can use just u and U.

Bonus useless tip: g? encodes and decodes rot13.

~~~
clarry
Thanks, I guess that explains why gg is needed to go to top. In my editor it's
just g. Maybe I'll come up with something clever.

------
nilved
Using xcape and xmodmap, I remapped caps lock to behave like control when held
and escape when tapped. That allowed me to remap control to hyper. I've really
liked this setup so far.

------
K0nserv
I use the same trick to remap caps lock to "shift+cmd+alt+ctrl" or "hyper". My
configuration is highly centered around using slate with the standard h,j,k,l
and also u,o,n to manage my windows. On top of that I also use the left side
of my keyboard for focus binds, for example hyper+q is Chrome and hyper+e is
iTerm2.

Here is my slate configuration for anyone interested:
[https://gist.github.com/k0nserv/8151008](https://gist.github.com/k0nserv/8151008)

------
stolksdorf
I've used Autohotkey (Windows) to remap my capslock to select the word my
cursor is currently in. Essentially pressing ctrl+left, then ctrl+shift+right.
I too have become so use to this that using other people's keyboards is
frustrating. I've taken this a couple steps further, shift+capslock selects
the current line and ctrl+capslock activates Sublime's multicursor feature.

~~~
usea
This won't work in everything, will it? What about if your cursor is at the
beginning of a word? Not to mention that different editors stop in different
places with ctrl+arrows. Many editors have a key combo for select word
already. In Visual Studio it's ctrl-w.

~~~
stolksdorf
I've been using it for about 1.5 years, and it's been mostly consistent
between applications; Notepad being the only one I've noticed with odd
characters it includes in the ctrl+arrow movements. I really like the approach
using Autohotkey because it becomes universal on my system, so capslock can
select words in chrome, IM apps, etc. I don't have to worry that the app
supports that feature.

------
philip1209
I map mine to control. I switched from using "Escape" to ctrl-c in vim, which
plays nicely with this key mapping.

~~~
gfodor
FYI you probably want to use ctrl-[, ctrl-c has some cases where the behavior
isn't the same as ESC

------
a_olt
[https://upload.wikimedia.org/wikipedia/commons/7/71/Das_Keyb...](https://upload.wikimedia.org/wikipedia/commons/7/71/Das_Keyboard_closeup.jpg)
The possibilities are endless, of course :)

------
stevewillows
Disabling CAPS is one of the first things I do when I refresh a system. I've
always wanted to find a better alternative, but as of yet, it hasn't presented
itself.

I've thought about mapping it to alt+tab since I use VNC quite a bit.

------
Namrog84
I am very unoriginal, uncreative, and uninovative.

Aside from browser and maybe calculator. What else would be good to hot key
like the op author describes? Thanks!

------
darkbot
Caps-Lock should of course be remapped to Control.

~~~
twic
Caps lock is already control - CRUISE CONTROL FOR COOL.

------
paulnechifor
While on the topic of useless keys, what do you think of the Menu key?

I use mine for a drop down terminal (Tilda, or Yakuake before).

------
gcb1
sad how linux fell behind on keyboard customizations.

used to be the only place where i could replace caps-esc and use altGr for
accents.

now windows with autokey(?) allows me to use caps as esc if pressed once, or
ctrl modifier if pressed with another key.

i cant find a way to do that in linux now.

~~~
keenerd
Scroll up, see kozikow's post about xcape.

------
wahnfrieden
Kinesis user: caps lock mapped to shift (home row), left shift mapped to
escape (vim).

------
DomKM
Great post but it's over a year old. Shouldn't it be labeled as such?

~~~
jrockway
That makes sense for news or trip reports, but what has changed about
keyboards in the last year? Nothing I can think of.

------
FrankenPC
I can't stand the caps lock key at all. I pop them all off my keyboards.

------
userbinator
XML? For _key remapping_? Seriously...?

------
cenhyperion
Mine's mapped to escape because vim.

------
holychiz
i ran org-mode with vim so i set caps lock key to ctrl and right Cmd key to
esc.

------
blazespin
"I’ve become quite used to it — to the point where using other people’s
keyboards is inconvenient. " I stopped reading right there.

~~~
voltagex_
Why? Even without interesting remappings, aren't you more used to your own
keyboard than someone else's?

