loading...
Cover image for Upgrade macOS to Utilize Keyboard Shortcuts for a more Productive Development Workflow

Upgrade macOS to Utilize Keyboard Shortcuts for a more Productive Development Workflow

doppelmutzi profile image Sebastian Weber Originally published at doppelmutzi.github.io ・6 min read

Using a mouse or trackpad is a major distraction and flow-breaker for many development tasks, especially programming. I strive for using keyboard shortcuts as much as possible to be more productive while programming.

Out of the box, macOS does not provide many keyboard shortcuts when it comes to window management. As an example, there is no way to move a focused window to another space by keyboard.

In this article I want to present my curated list of useful tools to manage windows, displays, and spaces (of Mission Control) without a mouse. I hope you retire your mouse after reading this post. 😉

Alfred – Application Launcher on Steroids

Alfred is an elite application launcher and utility to search and find files on your machine or on the Web. I use Alfred instead of Spotlight. The hotkey to open up the launcher panel has been burned into my brain for a long time. Of course, you can define a custom key combo in Alfred's settings.

You can define a custom Alfred hotkey to activate

Alfred is very versatile, you just have to fire up the panel with your defined hotkey and you can start typing. Most of the time I type the starting characters of an app I want to launch. However, you can do more from this input field, e.g., start a google search as you can see from the next screenshot (marked by ⌘5).

Launch apps or search for content

To open a file or folder on your machine, start typing open and Alfred assists you with recommended actions shown in the result list.

Alfred has many more awesome features like snippets or workflows, which I will not cover here. Take a look at Alfred's power pack. I want to point out one awesome feature and that is Clipboard History. You can define a shortcut in the Features section of Alfred's settings.

You can define a clipboard history hotkey to invoke the associated panel

If you press the defined hotkey, a clipboard history panel appears and allows you to paste more than the last copied item.

Clipboard history allows for pasting more than the last copied item

Spectacle – The Missing Window Resizer

Spectacle is an awesome tiny tool that allows for changing the size or position of a particular window. It upgrades macOS in a way that you can use keyboard shortcuts to resize or move focused windows of any app. Sophisticated window management by shortcuts is one aspect I have missed from Microsoft Windows when I was working on a project with PCs as development machines.

In my current project, I have an environment with two external displays in addition to the built-in display of my MacBook. Spectacle provides
customizable shortcuts even for throwing a focused window to another display. Therefore, you can specify shortcuts in Spectacle's settings dialog for Next Display and Previous Display.

Settings of Spectacle

Besides moving windows from one visible display to another, I highly use shortcuts to resize windows like Make Larger, Make Smaller, or Left Half.

I appreciate Spectacle's simplicity. You have a nice glasses icon in the menu bar to see all window actions along with keyboard shortcuts at a glance.

Easy access from menu bar entry

The following recording gives an impression how Spectacle works. I used the shortcuts as you can see in the screenshot above.

Spectacle is brilliant, however, it lacks one feature I really need. I need to move windows also to invisible spaces. Spectacle only allows to move windows between visible spaces (i.e., displays) by defining shortcuts for Next Display and Previous Display. Luckily, the next tool can help out.

Amethyst – A Handy Tiling Window Manager

Amethyst constitutes a tiling window manager for macOS. It has some features in common with Spectacle, e.g., increasing and decreasing window sizes by shortcuts. However, as you can see from the screenshot about Amethyst's settings, the tool provides many more useful shortcuts.

Shortcuts section of Amethyst

My personal killer feature is the ability to throw focused windows to a particular space. I very often move a window to the left or right space (Throw focused window to space left or Throw focused window to space right).

Another very handy feature does not require using shortcuts at all. Amethyst rearranges windows on a display automatically (i.e., visible space in focus). As an example, if you have a single browser window on your active display and you open another browser window by ⌘ N, both windows are positioned next to each other with the exact same width and height. If you put another window of any software on this display, all three windows are rearranged again in a way that there is no overlapping. Wicked!

Contexts – An Improved Command-Tab Switcher

I use Contexts primarily for an improved "Command-Tab switcher".

Better Command-Tab Switcher

Contexts adds the ability to select individual windows by using the learned key combos ⌘ ⇥ and ⇧ ⌘ ⇥ (to move up the list). In the settings you can also define other shortcuts for these actions. Additionally, you can also use multiple shortcuts for invoking the window switcher with individual settings, which is not possible with macOS default switcher.

Define multiple shortcuts for window switching

As you can see from the previous screenshot, you can define any number of shortcuts to activate the window switcher and to move the list up and down. What I really like is that you can restrict the list for every shortcut, e.g., show only visible spaces.

Another major time saver is Contexts' search capability. Actually, it acts more like a filter for the window list. When you have activated the switcher panel, you can just start typing (with pressed hotkey) and, thereby, filter the list to save the time for moving up and down the list.

Even faster window selection by searching

You can even optimize this workflow by defining a modifier key to activate and use the fast search feature. To switch to a window, press this modifier key and type a few characters from the app name or window title. As you can see from a previous screenshot, on the left-hand side of the switcher panel characters are shown that show you suitable strings for fast search.

What I also like is that I can remove particular apps from the switcher panel's list, e.g., macOS Finder, because I'm not convinced of this tool and use instead an alternative.

macOS Build-in Shortcuts

There are some shortcuts to use Mission Control without a mouse. For me, the most important one is to switch between spaces by pressing ⌃ ← or ⌃ →. To open Mission Control or show its spaces bar press ⌃ ↑. To show all windows of an application side by side press ⌃ ↓.

Of course, the following shortcuts should become second nature if you want to be productive on a Mac. ⌘ Q quits applications along with all its windows. To close a focused window press ⌘ W. To copy and paste things use ⌘ C and ⌘ V.

Another useful shortcut during my office hours is locking the screen by pressing ⌃ ⌘ Q. In addition, a useful shortcut to kill none-responding applications is ⌥ ⌘ ESC.

KeyCue – Shortcus Always at a Glance

If you cannot remember these system shortcuts, you can take a look at the application menu. If a command provides a shortcut, you can find it on the right side of the menu entry. An even faster approach is to use KeyCue. It's a useful tool to show all shortcuts of the current application which is currently in focus along with system shortcuts. The goal of KeyCue is to find, remember, and learn keyboard shortcuts.

Find, remenber, and learn shortcuts with KeyCue

You can show the list of shortcuts for a focused app from the keyboard. As an example, I configured KeyCue to show the list by pressing the key for 1.5 seconds.

Activate KeyCue with hotkeys

Summary

I want to point out that the presented tools provide way more features. However, these are the most important capabilities for me to reduce mouse usage.

Resizing and moving windows between visible and none-visible spaces with just a few keystrokes has significantly improved my productivity during a course of a day. I hope I could provide you some inspiration to improve your development workflow.

Posted on by:

Discussion

markdown guide
 

Great write up and probably the article to finally push me to try Alfred. I have not seen Contexts before, I'll have to give that a look.

Also, nice Dirk Nowitzki wallpaper. He's been my favorite NBA player since I was in elementary school.

 

finally push me to try Alfred

Do it, you won't ever look back :)

 

Thanks, I'm glad you like my article. Nice that you noticed my Dirk wallpaper :-)

 

I love Spectacle's functionality, but I find their shortcuts to be insane. Are you aware of other tools that are easier to use? I don't have the paid version of Alfred, but can Alread allow something like that to be scripted? I really only use it to switch displays and align left and right halves on my widescreen monitor.

 

What do you mean with "insane"? It's in the nature of things that you have to press 2 or 3 keys of Cmd, Option, Ctrl, etc. for managing focused windows. Otherwise you most probably use a key combo that is already reserved by the focused app or macOS. In addition, you can define your own shortcuts. E.g., it's easy for me to remember my Spectacle shortcuts. I press all of these special keys and than use:

  • N (Next display)
  • P (Previous display)
  • ↑ (focused window should consume upper half of display)
  • ← (focused window should consume left half of display)
  • ... There are many tools like Spectacle, e.g., Amethyst. However, there you have the "same problem" to define "cryptic shortcuts". I use Spectacle for most of window management, because I find it easy to use. If I forget a shortcut or want to go to preferences to define shortcuts, I have to click on the menu item.

I haven't mentioned all of Alfred's features. There are many more if you use Alfred's Powerpack. There are scripting capabilities I also plan to check out in the future: alfredapp.com/help/workflows/actio...

 

I should have mentioned that part of what complicates the shortcuts is my love of mechanical keyboards, I don't have any of my keyboards configured for OS X layout and mostly interact with my MacBook through a virtual KVM switch, so it can be confusing going back and forth.

 

i generally don't understand why none of these powerful but ever so commercial tools have a well known freemium / open source counterpart.
mac OS's universe is riddled with software that does rediculously simple stuff, yet costs 20 dollars, like KeyCue it shows a et of shortcuts ... how is everyone just ok with paying 20 dollars for such a thing.

 

Part of me wishes Apple would just bake these features in instead of giving us so much useless fluff. But the other part of me is happy to see developers profiting from the lack of super user features Mac OS lacks. So 🤷‍♂️

 

hi James, I have a similar opinion on that topic. Even if Apple would bake these features into macOS they couldn't satisfy every developer. Therefore I'm glad that Apple's ecosystem allows developers to create such a great variety of tools.

 

Nice article! I'm glad you mentioned Amethyst I have been a big fan for a long time! I would like to add another useful tool, it's a great open-source clipboard manager for macOS called Maccy. Check it out here github.com/p0deje/Maccy

 

Thank you for your recommendation. I will definitely check Maccy out. It seems to be a fee alternative for Alfred's clipboard manager.

 

Please add skhd to this guide. I have been using first khd and then skhd for 2 years now and it is absolutely fantastic.

It provides a simple dsl for mapping any key combination to a shell command. It gives you virtually unlimited ability to control what your computer is doing. You can also combine it with tmux to great effect as tmux comes with a CLI interface.

github.com/koekeishiya/skhd

You can even use skhd bindings to change skhd bindings as seen in my config file:

github.com/kwstannard/kws-scripts-...

 

It is great to know about these apps, thank you for this article.

Would like to suggest some corrections in the section macOS Build-in Shortcuts. Shortcuts in the first paragraph of this section work with Control, while the article mentions to use Options. :)

 

Thanks a lot. You're totally right. I have updated the shortcuts in the macOS shortcut section.

 

For the future readers, Spectacle is no longer maintained, and the users recommend using Rectangle instead.

 
 

I am a huge fan of Keyboard Maestro; it serves all of my requirement to create custom shortcuts, or mapping keys, or create complex macros.