David A. Antler
Using a Mac
Once upon a time I was very productive using Windows (and Linux). One thing I had to pick up this year was how to become productive on a Mac, but it’s very different than the other two. Even simple things like ALT+TAB don’t work the same way! My first few days on a Mac felt foreign and confusing, so I spent some time fixing the issues I found.
A little background: I still use Mac, Windows, and Linux systems regularly, so uniformity is important for me. For me to be productive, my interface to every machine that I use needs to be as similar and therefore frictionless as possible. A few frustrating seconds spent correcting my misclicked hotkey is a few less seconds spent on whatever real problem I’ve set out to solve. My goal is to be able to do the same workflows on all systems.
Here are a few things I find really important and the associated workarounds.
1. Hotkeys should work the same everywhere
On my first day of using the Mac, trying to find text in Safari with CTRL+F would derail my entire workflow. I’d have deal with a minor frustration and eventually discover the Mac shortcut instead; something involving the CMD key. Fortunately there’s a solution for Mac that will allow either the Windows or Mac key combinations to work!
Redundant hotkeys for the same thing can be accomplished on the Mac by installing an amazing tool called Karabiner. Karabinier is a smart key remapping tool that lives up in your taskbar and can remap keys specifically tailored to whichever application is in focus.
The really important keys for me are opening and switching tabs, copying and pasting files, and closing programs and tabs. These all work without any issues in my current configuration.
Here’s a link to my Karabiner json configuration file. It should be placed in your ~/.config/karabiner/assets/complex_modifications
folder and enabled inside the Karabiner app. You’ll need to create a new profile and add these complex configurations one-by-one.
2. Windows should snap to the edges of the screen
One useful behavior of Windows is the ability to drag a window to the edge of the screen to have it automatically resize. A hotkey to do this is very useful as well.
This feature can be had on the Mac, too, but you’ll need to install a separate app to do it. I use BetterSnapTool. It’s $3 very well spent!
Dragging my web browser to the left edge of the screen!
3. Highlight and right click to copy/paste in a terminal
One of the best things about the Windows CMD.exe terminal (bear with me) is the Unix-style copy-and-paste workflow enabled by the “QuickEdit Mode” checkbox. This allows you to highlight something in the terminal with your mouse, right click to copy it, and then right click again to paste it. This is incredibly useful if you use the command line often, since you can usually find some of your parameters (such as a complex path to a file or a git commit hash) on the screen already.
4. Ads should be blockable
Safari is an excellent web browser, but many sites have obtrusive ads that you may want to block to better view the content. I found what looks like a legitimate uBlock Origin extension at this link.
5. Capslock should map to escape
As a longtime Vim user, I hit the ESC key all the time. If you use it, too, then the touch bar included on many models of the new MacBook Pro machines will drive you nuts. A good workaround is to remap capslock to send an ESC scancode. This needs to happen on both Windows and Mac if you want your hotkeys to be the same.
On Windows I now use dual-key-remap. It’s an extremely lightweight key remapping application and the default behavior does exactly what I want! You’ll need to follow the instructions in the readme to make it launch automatically on start-up.
On Mac you can do it using the Apple -> System Preferences menu. Karabiner can be used too but is not required.
6. gdb should work more like WinDbg
I’ve spent more time using WinDbg than any other debugging tool. Its syntax is more concise than any other debugger I’ve used. Unfortunately it works on Windows with PE files, and the Mac’s default compiler makes ELF binaries. I can’t imagine Microsoft is interested in porting this tool to support ELF!
While duplicating the command set exactly would be impossible, supporting a few key operations like dumping register values, dumping assembly, overwriting a register, and decoding ASCII are easily within reach. I’ve modified a that provides some of that functionality!
If you have something similar for LLDB, please reach out to me!