Developers at The Nerdery have a lot of choices to make when they start their new job. Although having a dozen different types of cereal in the cafeteria to choose from seems like a big decision to make, it rarely impacts their work performance. Each employee has a decision to make over their choice of workstation and development tools.
Scott Carpenter shares his experience when he joined the ranks of code-ninjas here at The Nerdery and how he made a very adventurous choice to “try something new”.
Learning New Tricks, My Mac Experience
by Scott Carpenter
An email from The Nerdery after I accepted the job:
“Let us know what you want to use, Mac or PC, and what software you’ll need so we can have everything ready when you start.”
Not entirely unexpected, and this is as it should be, but, what a refreshing statement! It told me, you’ll have some freedom of choice here. (Unlike the scenario where you’re not even allowed to set your browser’s home page, which has happened to me and was less than empowering.)
Well, what did I want to use? I’ve used Windows since slightly before Win 95 launched, and at home, exlusively GNU/Linux since 2008. I’m comfortable and productive with both, and was aware that Ubuntu might even have been a valid choice, but I thought: maybe it’s time to see what this Mac business is all about. Macs have good hardware and are pretty. And they have Unix under the hood, right? Okay then.
I had some doubts on my first day when I realized, I don’t know how to use this computer. This is a building full of smart people, and I’m new, and I don’t even know how to use my machine. But a computer is a computer. You know what you should be able to do; you just have to find out how to do it on this weird fruity machine. Luckily there is this thing called The Google, and there were my fellow Mac-using newbs to help me with things like finding the power button.
So what happens when you start using a Mac? I’m going to focus on a couple of keyboard-related problems you’ll run into immediately, especially if you’re a developer that uses the keyboard a lot, and you spend a lot of time in various editing windows. I’ll give you a couple of sanity-saving and life-improving tips.
But first we should talk about balance. In particular, when configuring a machine, whether hardware or software. I’ve learned there’s something to be said for accepting the defaults when possible. It simplifies your life and saves time by reducing the endless customization you’ll tend to do.
But then again, tinkering is fun. And we’re all different. It’s not just about how Steve wanted you to use a computer. It’s also about your needs, and your feelings. Instead of saying, “You shouldn’t want to do that,” or asking, “If you want it to work like Windows, why don’t you use windows?”, let’s fix the glitch.
The first thing is fairly simple, having to do with this strange “command” key. There is a control key on the outside left and right positions on a Mac keyboard, as is proper, but it’s not like the control key you know. Instead, the peculiar “command” button has usurped most of its power.
This turns out to be okay. Many of the key combos you’re used to work just fine with command. But. It’s in the wrong place. So the first thing you’ll want to do is swap the command and control buttons in “System Preferences… > Keyboard > Modifier Keys…”
It may be helpful at first to re-label the keys to remind you of the change:
This developer’s properly configured and labeled Mac keyboard.
(We’ll pause for a moment to allow for weeping from native Mac users.)
The next thing we’ll fix is the atrocious behavior of the “home” and “end” keys.
By default, the home key will scroll to the top of your document, but leave the cursor wherever it’s at. End will likewise scroll to the end. This is completely unacceptable. Here is what our fingers have been trained to use:
||Move cursor to beginning of current line.
||Move cursor to end of current line.
|Shift + Home
||Select text from cursor to beginning of line.
|Shift + End
||Select text from cursor to end of line.
|Ctrl + Home
||Move cursor to beginning of document.
|Ctrl + End
||Move cursor to end of document.
|Shift + Ctrl + Home
||Select text from cursor to beginning of document.
|Shift + Ctrl + End
||Select text from cursor to end of document.
I found a nice solution, which I’ve extended after a bit more research. I like this method because it doesn’t require a third-party program, and it can be set per user.
You’ll need to edit the default key bindings file:
On my machine, the
KeyBindings dir and the
DefaultKeyBinding.dict didn’t exist, so I just created them. Add the entries below:
/* Remap Home / End to Appropriate Behavior */
/* Home */
"\UF729" = "moveToBeginningOfLine:";
/* End */
"\UF72B" = "moveToEndOfLine:";
/* Shift + Home */
"$\UF729" = "moveToBeginningOfLineAndModifySelection:";
/* Shift + End */
"$\UF72B" = "moveToEndOfLineAndModifySelection:";
/* Cmd + Home */
"@\UF729" = "moveToBeginningOfDocument:";
/* Cmd + End */
"@\UF72B" = "moveToEndOfDocument:";
/* Shift + Cmd + Home */
"@$\UF729" = "moveToBeginningOfDocumentAndModifySelection:";
/* Shift + Cmd + End */
"@$\UF72B" = "moveToEndOfDocumentAndModifySelection:";
(Note that we’re using the command key in place of control, since we moved it to the correct position on the outside.)
You’ll need to restart an open application to use the new bindings in that app, and it doesn’t work in all applications. For example, it doesn’t work in the built-in Terminal program, but in there, you can go to “Preferences > Settings > Keyboard” and set home =
\\033OH and end =
\\033OF. (Make action = “send string to shell:”)
Side note: In Terminal, the command key doesn’t assume the control key’s duties. Your fingers will often forget this, pressing Command (AKA pseudo-Control) + C or D, and you’ll wonder why your program doesn’t stop.
Bonus tip: Your fingers also may want to use Ctrl + arrow keys to move left and right one word at a time, and also to use “shift” to select the words. For that:
/* Cmd + Left */
"@\UF702" = "moveWordBackward:";
/* Cmd + Right */
"@\UF703" = "moveWordForward:";
/* Shift + Cmd + Left */
"@$\UF702" = "moveWordBackwardAndModifySelection:";
/* Shift + Cmd + Right */
"@$\UF703" = "moveWordForwardAndModifySelection:";
(Again with Cmd because we’ve moved it into the Ctrl spot.)
More useful info here.
I also spent time learning new habits and adjusting to “what is,” but these changes to “what should be” helped me feel much more comfortable in the new environment, along with getting a proper ergonomic keyboard and trackball:
Now we're iComputing!
It’s been a lot of fun. OS X is built on Unix, and you can be happy “doing it wrong” by hanging out in the ugly and gross command line underworld. I found myself wanting to keep learning and playing with my new toy at home over the weekend. I missed it. It’s a beautiful machine, and I love to learn and explore new things. I suddenly realized I was looking at the price of new iMacs. I kinda want one for home, too.
Scott Carpenter was first introduced to programming in 1981 when Scott’s dad, an electrical engineer, gave him his first computer to encourage his interest in programming. It worked – in 1998 Scott graduated from St. Cloud State University with his Bachelor of Science in business computer information systems. Scott went on to work for Cargill for 15 years as a software developer where he focused on application integration, integration design and development. In 2013, Scott’s journey brought him to The Nerdery where he puts his technical expertise to use as a PHP, WordPress and Java developer.