Obviously, in Linux I can use xmodmap. On Leopard, I used an InputManager called PCKeyboardHack. But InputManagers are now broken.
How can I preserve my sanity and keep on using Caps Lock to Escape in OS X 10.6?
Super User is a question and answer site for computer enthusiasts and power users. It only takes a minute to sign up.
Sign up to join this communityI may be way off as I'm nowhere near my Mac to check, but would Ukelele be able to remap the Caps lock? I know you can remap the Caps lock using system preferences too, but I think the possible replacements are limited (again away from a Mac to test)...
You could also see if doublecommand has that mapping included, as reports suggest it works in 32bit kernel mode in SL at least...
There seems to be a PCKeyboardHack fork for SL:
It's not really an answer to your question, but I imagine you want to remap the key so your finger hasn't so far to travel to switch Vim modes. A week or two ago I discovered that Ctrl-[
is the same as hitting Esc
, and easier to type even though it's two keys.
I'd suggest teaching your fingers to do Ctrl-[
instead, then you don't need to remap any keys and you don't lose Caps-lock functionality.
had two issues when compiling.
1: Make sure you have the developer stuff in your path. specfically, add the following line to your path:
/Developer/usr/bin/
2: some bizarre error with otool not being found: the error I got looked like this "*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'launch path not accessible' "
use this to resolve it:
ln -s /Developer/usr/bin/otool /usr/bin/otool
after that, everything worked for me.
Though this does not answer your question it might be the solution to your problem:
" Mapping ESC in insert mode and command mode to double i
imap ii <C-[>
cmap ii <C-[>
Put this into your .vimrc file. After that you can press ii to get out of insert or command mode. You do not need to reach out to your ESC or CAPS lock key.
I use Seil to remap my Mac keyboard https://pqrs.org/osx/karabiner/seil.html.en
Note, you must also nullify the default Caps Lock key from your Mac Keyboard settings.
It may be obvious, but with recent macOS version, we can natively do this in the keyboard settings (sorry screenshot in French):