22 January, 20222 minute read

How to get macOS hotkeys working in iTerm

macOS has a bunch of great Emacs-derived keyboard shortcuts for editing text -- ⌃a, for instance, will take you to the start of the line you're editing. These keyboard shortcuts work throughout the vast majority of applications on macOS, which means you have access to robust text manipulation shortcuts even when you aren't inside a proper text editor. People at Apple have clearly put a lot of deep thought into how experts use their software, because macOS' keyboard shortcuts are leagues better than on Windows and Linux.

The ultimate killer feature is the ability to incrementally search application menu bars to discover keyboard shortcuts. It's infinitely better to holding alt on Windows to reveal keyboard accelerators, and the only downside is that it doesn't work when applications don't put all of their functionality in the menubar as is the case with Zoom.

Example of searching the macOS menubar

(If macOS had decent in-built window management... but that's what Magnet or Rectangle are for.)

Unfortunately, the navigation shortcuts using command ()/option () and an arrow key don't work in terminal emulators like iTerm, and it's not entirely obvious how to add them to iTerm manually. While all of these do have control-key equivalents, the command/option variants might be easier to use for you. Here's how you can do it:

  1. Open iTerm
  2. Navigate: + , → Profiles -> Keys -> Key Mappings
  3. Click the + button for each of the following:
    • Keyboard shortcut: + ; Action: Send hex code 0x05
    • Keyboard shortcut: + ; Action: Send hex code 0x01
    • Keyboard shortcut: + ; Action: Send hex code 0x15
    • Keyboard shortcut: + ; Action: Send esc sequence b
    • Keyboard shortcut: + ; Action: Send esc sequence f
    • Keyboard shortcut: + ; Action: Send hex code 0x17

Don't want to miss out on new posts?

Join 100+ fellow engineers who subscribe for software insights, technical deep-dives, and valuable advice.

Get in touch 👋

If you're working on an innovative web or AI software product, then I'd love to hear about it. If we both see value in working together, we can move forward. And if not—we both had a nice chat and have a new connection.
Send me an email at hello@sophiabits.com