Up until recently, I have been writing code on windows and linux machines. All that has changed. The folks at the newish job got me a shiny new macbook. And while it is by far the best machine I’ve ever owned, it is not without flaws: the command and option keys. W-T-F?
When I use the computer, the majority of my time is spent moving around in some text editor with the keyboard. Here is my gripe: the control, option, and command keys do the same work as the control key on other systems. I tried this configuration for a couple weeks and almost went crazy. Command+right moves you to the end of the line, WTF?! The end key (when you find it) moves you to the end of the file, WTF?! Option+right moves you to the next word, WTF?! Ctrl+arrows just make a bonk noise, WTF?! And on top of that, I couldn’t use my pinky to handle cut/copy/paste actions. GRRRRR.
So how do we fix this mac brokeassness? My approach was to essentially swap the command and control keys, then fix bindings here and there until I no longer got frustrated. It takes a bit of work. So lets get going.
This is the easiest part, and it gets you some pretty solid progress. Proper ctrl+C, ctrl+V! Yay! But this alone still leaves a lot to be desired.
Here you can remap the actions that move your cursor around in any native text widget such as TextEdit or textareas in Safari (note that it does not affect FireFox or any other browser). If you are a programmer, this will likely be important to you.
Basically, you create a file: ~/Library/KeyBindings/DefaultKeyBinding.dict
and put key binding
information in it. An explanation is at
heisencoder, and a
list of all possible options is at Erase to the left.
My file looks like this:
Swapping your command and control keys breaks the standard command+tab application switcher. Now it is ctrl+tab, which is handy for switching between tabs in an application.
OSX does not allow you to remap the standard Command+Tab (or in our case Ctrl+Tab) behavior. To get around this, you need to use a program called PullTab. PullTab disables the native application switcher. Then you can install a new, better application switcher called witch. There is a screencast available to help you along.
This will allow you to bind command+tab to other actions such as tab switching in your browser. I mapped control(the command key)+tab to the application switcher so the action feels like alt+tab.
It seems the mac’s default behavior for the home and end keys is to put the cursor all the way at the beginning and end of the document. This is even true in the terminal. Home will scroll you all the way to the beginning of the terminal’s buffer! Whoa. I expect the home and end keys to put you at the beginning or end of the line. This can be changed.
\033[F
\033[H
There are a few applications I could not figure out how to remap. Firefox is my main point of contention. HTML text boxes do not respond to the text editor key binding changes listed in number 2 of this post, and I have not been able to figure out how to remap them in the application itself. It isn’t a big deal, but would be nice.
Well, I hope this helps. You should have a mac that now responds to your old habits! On with it!