Skip to content

Instantly share code, notes, and snippets.

@jonasdiemer
Forked from lornajane/mac.md
Last active October 6, 2020 19:38
Show Gist options
  • Save jonasdiemer/004199cf9aca563b8958e83479f1194c to your computer and use it in GitHub Desktop.
Save jonasdiemer/004199cf9aca563b8958e83479f1194c to your computer and use it in GitHub Desktop.
Keyboard Only OS X

Keyboard-only Mac Cheatsheet

Taken from Lorna's notes. :)

Apps List

There's more detail on a few of these apps but here is a quick overview of the tools I've installed and found helpful

Tool Link Comments
karabiner-elements For vim-like movements with vim-mode-plus (https://git.sr.ht/~harmtemolder/karabiner-vim-mode-plus)
chrome + vimium https://vimium.github.io/ Control your browser entirely from the keyboard. Awesome for productivity nuts as well as computer-crippled people :)
shortcat https://shortcatapp.com/ Game changer. I don't want to overstate this but this tool allows me to click on more or less anything on my screen. This is the app that means I don't have to find console-equivalent tools for everything I do, I can use a GUI tool just like you!
alfred https://www.alfredapp.com/ Powerful launcher of all the things. And that's underselling it
hyperswitch https://bahoom.com/hyperswitch Makes alt + tab work within a desktop space rather than cycling through all open applications
spectacle (unmaintained) https://www.spectacleapp.com/ Moving windows around from the keyboard. I have no idea why this doesn't come out of the box but this tool helps a lot.
iterm2 https://www.iterm2.com/ Feels like a terminal and has bells and whistles that I may never master but I spent most of my time in a terminal so perhaps I should.

General Shortcuts

Cmd + , (comma) to access preferences for the current app

Ctrl + F2 focuses the top menu bar (you can turn off the machine from here)

Ctrl + F3 focuses the dock

related: you probably want to turn off Ctrl + F1 which enables and disables the above! Look in the keyboard settings.

Lock the screen: Ctrl + Shift + eject/power or say "lock" to Alfred.

Move cursor to the top of a long list: Alt + up

Delete a file in finder: Cmd + backspace

Spaces

These are a pain to set up but I love them because it means I'm looking at fewer apps on one screen and it's easier to jump to the one I want without a lot of Cmd + tab to switch between applications. To configure:

  1. Go to "Mission Control" using Ctrl + up

  2. Hover your mouse at the top of the screen (yes, I do have a mouse, I just had to go and find it out of a cupboard) and it will unfold to show a bar where you can add as many spaces as you like. Check the options in "System Preferences" -> "Mission Control" to decide whether you want this per screen or not. Mine are not, the space spans both monitors.

You can move between spaces with Ctrl + left/right or there are keyboard shortcuts to enable via the keyboard settings area which enable going to a specific space by number Ctrl + 1 etc. This probably is more useful if you don't allow the mac to re-order your spaces as it pleases (this is a setting, I like mine to stay where I put them but YMMV).

Apps

Switching windows within an app Cmd + backtick.

In iterm2, also press Cmd + Alt + [number] where the number is displayed in the window bar. For switching between tabs, you can use Cmd + number - this also works in Chrome. For other apps try Cmd + Shift + ] or [.

Alfred

Alt + space to run any program. Alfred can do a hundred more things than this, well worth more research!

Shortcat

Shortcat might be the killer app for me on OS X. It can "see" and make "clickable" more or less any control in an application, including the content. To use:

  1. Type Cmd + Shift + space

  2. If the thing you want is labelled in words, start typing the words or the first letter of each word. If not, type a dot/period, which will show everything.

  3. If the thing you want is now highlighted in blue rather than yellow, press enter.

  4. If not, hold Ctrl and start typing the label. When the highlight is on the thing you want, press enter.

Note that you will need to allow Shortcat some accessibility permissions to run. The installation process will prompt you or you can find it in "System Settings" -> "Privacy" -> "Accessibility"

Vimium

I have been using Chrome for ages with a hacked version of an old accessibility plugin; I just added vimium because I needed something to use on the day I got my new mac. And ... it's fabulous, I'm now using it everywhere :) If you're not familiar with it, it pops up a label on each clickable item in the viewable area, allowing you to click links, focus fields, etc.

The help file is really helpful but here are the commands I'm using the most:

To trigger the plugin:

  • f to open the thing you then click on in the same window
  • Shift + f to open the think you click on in a new window
  • Alt + f to open more than one thing in a new window (useful on search results where you want to open a few tabs of results)

Just press escape to get rid of the labels.

Magic extra feature: you can select text from a webpage using Vimium (I've spent a decade retyping the content I want between one window and another, this is basically incredible). Just start searching for the start of the string you want, press return when you've typed enough search string and if necessary press n a few times to get to the correct instance of what you wanted. Vimium highlights what you typed but then you can hold down shift and highlight as much more content as you want, and copy!! Look out that Home and End don't do as I expected, try alt+arrow or cmd+arrow while holding shift.

Site-specific Config for Vimium

Any sites that have keyboard shortcuts are pretty awful for keyboard users I'm afraid! I have some tools where I do use the keyboard shortcuts in the site itself rather than from vimium and for these sites, you can add an exclusion. Vimium's icon in your browser will default to letting you add exclusions for the current site - use * to turn it off completely for whatever page you are on.

Google mail exclusions: ?jknpxercgils#uldf (press shift + f to open links)

Google calendar exclusions: nxptm

The comments moderation page on my wordpress blog (/wp-admin/edit-comments.php): jkasd

https?://localhost:8000/* (this is where reveal.js is served from, sometimes is annoying if I serve something else on this port though!) fb

Spectacle

App to move your windows around on the screen. It can put them in corners, in half the screen, on the other screen, or whatever. If it could put them onto another space as well, this would be perfect. As it is, it's pretty damn good and I love it (I had some built-in stuff and some madcap scripts to do these things on Ubuntu). Install it, set it to run on boot and then:

  • Window to other screen: Ctrl + Alt + Cmd + left/right super useful when demoing with tiled desktops
  • Window fullscreen (normal fullscreen, not mac fullscreen) Alt + Cmd + f
  • Window fills half of screen Alt + Cmd + arrow (arrow towards the long edge you want your window on)
  • Undo what you just did to your window: Alt + Cmd + z

This app is quite awesome and I need to get my muscle memory improved!

HyperSwitch

This makes Alt + Tab behaviour a little less weird, especially with spaces in play because you can set a preference to say that it should include windows from both screens but not from other spaces. This means that I use the Cmd + number shortcuts to get to a space, then Alt + tab to the app I want. With a small number of apps on each space, it's very manageable and this approach works well for me. I do have a bit of a habit with a lot of iterm tabs and tabs/buffers in vim as well but it does work, honest!

Hyperswitch can also often get windows that standard Cmd + tab can't see, and it doesn't interfere with it so you can continue to use both if you wish.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment