Skip to content

Instantly share code, notes, and snippets.

@lornajane
Last active December 23, 2024 20:15
Show Gist options
  • Save lornajane/3892c39098cf70baa9c7a1874cddf233 to your computer and use it in GitHub Desktop.
Save lornajane/3892c39098cf70baa9c7a1874cddf233 to your computer and use it in GitHub Desktop.
Keyboard Only OS X

Keyboard-only Mac Cheatsheet

Hi, I'm Lorna and I don't use a mouse. I have had RSI issues since a bad workstation setup at work in 2006. I've tried a number of extra hardware modifications but what works best for me is to use the keyboard and only the keyboard, so I'm in a good position and never reaching for anything else (except my coffee cup!). I rather unwisely took a job which required me to use a mac (I've been a linux user until now and also had the ability to choose my tools carefully) so here is my cheatsheet of the apps, tricks and keyboard shortcuts I'm using, mostly for my own reference. Since keyboard-only use is also great for productivity, you may also find some of these ideas useful, in which case at least something good has come of this :)

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
vim http://www.vim.org/ I cheated here since I've been a vim user for a decade. Absolutely excellent editor that I can drive entirely from the keyboard though, basically this is the tool that allows me to be a software developer.
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 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.
irssi + openurl https://irssi.org/ and https://github.com/wertarbyte/irssi-scripts/blob/master/openurl.pl Most open source communities use IRC and so I spend a lot of time there. Irssi is a fabulous text-based IRC client that I've been using for years, and the openurl plugin lets me "click" on links so they open in my browser. This combination is MUCH easier than say slack or equivalents since I have a choice of clients and can script those clients.

General Shortcuts

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

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

Cmd + 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.

@serbixote
Copy link

@lornajane shortcat is still the best alternative at this moment?

@jonasrk
Copy link

jonasrk commented Nov 2, 2019

@marco2704 and others: shortcat is not actively maintained since a couple of years ago. Just recently an alternative has popped up: http://vimacapp.com/ The developer is very much active and is taking in a lot of feedback on his early versions.

@tim2CF
Copy link

tim2CF commented Nov 6, 2019

Nobody mentioned amethyst. It's the best tiling window manager for mac.

@tobiasbueschel
Copy link

I also really like:

  • BetterTouchTool very powerful software that allows you to customise keyboard shortcuts, your touchbar and much more
  • CheatSheet show application shortcuts by holding the cmd button
  • RocketTypist an easy-to-use text expansion tool

@civersen
Copy link

civersen commented Jun 2, 2020

I'm loving these at the moment:

  • Hammerspoon, I use this to switch windows (like f on vimium) and I also use it to resize windows. Can do a lot more though!
  • Vimac, like Shortcat but opensource.

@joereddington
Copy link

Popping by to recommend 'mouseless' as a firefox extension. It marks all links with letters in a similar way to vimium.

Also suprisingly useful: ^F8 takes you to the menu bar.

+1 for shortcat, spectacle, and vim.

Oh, Other commenters might be able to help me out with the keyboard-shortcut problem I've been having here

@bf4648
Copy link

bf4648 commented Sep 12, 2020

I would also like to recommend: DwellClick. I know that you still have to move the mouse but at least it takes care of the clicks. I would also recommend PhraseExpress

@bob-ortiz
Copy link

Are there any alternatives or suggested software for Linux? I recently had to install kubuntu on my old mac (processor wouldn't take any more new updates) and my trackpad is broken.

@tim2CF
Copy link

tim2CF commented May 12, 2021

@bob-ortiz i3 window manager, vim text editor, vimium extension for firefox, termite terminal with embedded vim visual mode

@bf4648
Copy link

bf4648 commented May 15, 2021

I also wanted to add vim-motion or the faster alternative: vimac. This is a great alternative to short-cat.

@bob-ortiz
Copy link

I also wanted to add vim-motion or faster alternative: vimac. This is a great alternative to short-cat.

Which of the two, vim-motion and vimac, have you preferred or found better? I've been using vimac for a while now but I was wondering how it compared to vim-motion.

@lornajane
Copy link
Author

@bob-ortiz I'm mostly a Linux user - this gist was created in a dark 2 years I spent having a work-issued mac! Just having a look at the list, some things I'd recommend for either platform:

  • Vimium (now with either Firefox or Chrome - I mostly use Firefox)
  • Vim (you knew that already)
  • irssi + openurl

The Linux (I'm using gnome but there will be alternatives for KDE) replacements for the other items are:

  • Albert (an alfred-alike) and I use that with CopyQ for clipboard history, mapped onto ctrl + ,
  • The built in terminals on Linux are great anyway!

Some of the apps in the original list are things that are supported anyway in Linux and that I missed when I moved over. For example there are built-in keyboard shortcuts for moving windows (try cmd + arrows for maximise and half-screening things, and if you use a second monitor then cmd + shift + arrow will move the window to the other monitor). Get the "tweaks" tool or the KDE alternative to get some more control over alt+tab behaviour, workspaces, and so on.

@bf4648
Copy link

bf4648 commented May 17, 2021

I also wanted to add vim-motion or faster alternative: vimac. This is a great alternative to short-cat.

Which of the two, vim-motion and vimac, have you preferred or found better? I've been using vimac for a while now but I was wondering how it compared to vim-motion.

I prefer vimac. I just seems to be faster. I have tried both. I recommend opening Vimac, then click the following button using the following path: Preferences > Bindings > Hold Space to activate Hint-mode.

@s-rajaraman
Copy link

@lornajane - You are my hero! I am suffering from RIS on my right shoulder and I've been looking for this exact document! Thank you!

@mutewinter
Copy link

@bf4648
Copy link

bf4648 commented Sep 2, 2022

Great video on how to open google via voice on a mac: open-google-by-voice

@jonasrk
Copy link

jonasrk commented Dec 20, 2022

Any opinions on wooshy vs homerow vs vimac vs shortcat ?

@reinaldo-calderon-team
Copy link

did you test https://github.com/godbout/Scrolla.docs for scrolling on any document/app?

@pendolino
Copy link

Raycast has become my default app for window management. Does a pretty decent job and nicely configurable plus you get all the other bells and whistles if you like em.

@npp1993
Copy link

npp1993 commented Jan 7, 2024

Spectacle seems to be deprecated in favor of Rectangle
https://rectangleapp.com/

Alt-Tab https://alt-tab-macos.netlify.app/ is also a free and open source app that's great for switching between windows, and offers a lot of customization.

Great list, thank you!

@pendolino
Copy link

Any opinions on wooshy vs homerow vs vimac vs shortcat ?

I think Homerow is the newer version of Vimac? Shortcat seems quite similar.

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