DEV Community

Cover image for Upgrade macOS to Utilize Keyboard Shortcuts for a more Productive Development Workflow
Sebastian Weber
Sebastian Weber

Posted on • Originally published at doppelmutzi.github.io

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

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.

Top comments (15)

Collapse
 
camerenisonfire profile image
Cameren Dolecheck

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.

Collapse
 
jamesthomson profile image
James Thomson

finally push me to try Alfred

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

Collapse
 
doppelmutzi profile image
Sebastian Weber

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

Collapse
 
saelfaer profile image
Sander Houttekier

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.

Collapse
 
ssimontis profile image
Scott Simontis

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.

Collapse
 
doppelmutzi profile image
Sebastian Weber

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

Collapse
 
ssimontis profile image
Scott Simontis

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.

Collapse
 
jamesthomson profile image
James Thomson • Edited

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 ๐Ÿคทโ€โ™‚๏ธ

Collapse
 
doppelmutzi profile image
Sebastian Weber

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.

Collapse
 
yougotwill profile image
Will G

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

Collapse
 
doppelmutzi profile image
Sebastian Weber

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

Collapse
 
kwstannard profile image
Kelly Stannard

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

Collapse
 
ahmedam55 profile image
Ahmed Mahmoud

That's very helpful!

Collapse
 
firozansari profile image
Firoz Ansari

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.

Collapse
 
doppelmutzi profile image
Sebastian Weber

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