As I spend a lot of time working on my computer, as developers do, I look for ways to improve my workflow. One of my favorite ways of navigating OSX nowadays came from disliking Alt + Tab-bing to switch applications.
(It’s “Command + Tab” on OSX of course.)
It’s slow. It takes me out of what I’m doing and makes me think about where in the list the application is that I want to open.
Instead I use shortcuts to open applications:
Ctrl + 1: open iTerm.
Alt + 1: open iTunes.
Ctrl + 2: open MacVim.
Ctrl + 3: open Chrome.
Cmd + Shift + E: open Dash.
I’m editing a file and want to commit a change.
Alt + Tab quickly to iTerm.app. Oh I used Chrome last, not iTerm. Better Alt + Tab again. Oops! Pressed Tab three times, better go round the entire list or Shift + Tab to go back.
What did I want to do in iTerm again?
Especially when I’m working with more than two applications Alt + Tab gets in the way. The order of the Alt + Tab list is based on their last use. There’s not a very high chance I need to switch back to the previous application all the time.
My development environment usually includes having iTerm, MacVim, iA Writer Pro, Photoshop and Chrome open at the same time. Switching becomes a pain.
So I wanted something else..
It was actually Microsoft Windows that got me used to these kinds of shortcuts. It started with
Windows + E to open Explorer and
Windows + R to open the “Run” window.
In Windows 7 (maybe even in Vista) they added support for numbered shortcuts for applications on the task bar.
Windows + 1-9 opened the application on the 1-9th position on the task bar. I loved this feature and when switching to OSX years ago it was one of the things I really missed.
Luckily I found an alternative in Quicksilver’s triggers. It has a very nice UI that allows you to set up almost any kind of shortcut combination to open an application of choice.
I wasn’t entirely happy with it so I gave a Mjolnir fork, Hammerspoon, another go recently. Hammerspoon you to set up the same shortcuts as Quicksilver. However, this tool can do a lot more than just shortcuts. I also use it for window management now, something which previously I used the awesome Spectacle.app for.
There’s no UI in Hammerspoon like in Quicksilver and Spectacle, instead you write all your config in Lua.
I actually like Hammerspoon more since I can do a lot more than defining application shortcuts. This means I’m now in the process of moving all my configuration over from Quicksilver and Spectacle to Hammerspoon. You can see my configuration in my dotfiles.
My setup (an example)
Ctrl + 1: iTerm
Ctrl + 2: MacVim
Ctrl + 3: Chrome - development browser
Ctrl + 4: Opera - reading browser
Alt + 6: Photoshop
Ctrl + 0: Airmail
Alt + 0: Slack
Ctrl + E: Finder
This setup saves me time switching between applications every day, but more importantly, I can continue concentrating on whatever I’m working on.
The full list of shortcuts can be found in my dotfiles as well.
But what about Spotlight?
I realized I never really use OSX’s Spotlight to look for anything.
It doesn’t help with quickly switching between applications. I first have to open spotlight with
⌘ + Space, then type a part of the application name, but it might conflict with something else, so I have to type more and… it just doesn’t work for me.
I pretty much only use spotlight as shortcut for a calculator and currency converter.
What about the Dock/a mouse?
There are enough reasons why I consider a mouse to be even worse for switching applications.
For me the main reason is RSI complaints.
The downside to this setup? It overrides some shortcuts set up by applications, but I can work around that or remap them in the application itself.
The big thing is that you need to remember what application is under what shortcut, because there’s nothing on screen that tells you what is what. It takes a bit of practice, but nowadays it’s more muscle memory than having to think about what I want to open.
My Alt + Tab process is like this:
- Alt + Tab - Find application - Tab - Tab again - Repeat until found - Release
Or I just use a very specific shortcut to go directly to the application I need.
- Ctrl + 1 - Release
Optimize your workflow!
Maybe this setup is nothing for you, but I hope this post makes you think about better and faster ways to work on your machine. There are plenty of other ways to switch between applications.
Maybe you think I’m overthinking it and I’m optimizing just to optimize, but it works for me!