Hammerspoon1 boasts two things: a truly epic project name and a lua scripting environment that hooks into extensions that allow you to control system functionality in macOS.

Over the years, it has completely changed how I do a couple small but important tasks. Hammerspoon is a generic tool, but the functionality I use by far the most is window layout management.

Stop using the mouse - Start using your keyboard (for navigation)

Navigating windows with the mouse is inefficient (it takes much longer than with the keyboard) and also somewhat ineffective (it is much less precise than with the keyboard). In order to use the keyboard for window management we first need to be able to navigate with the keyboard

So, first things first: Cmd+Tab and Cmd+Shift+Tab switches the current window to the next (or previous) application. Similarly, Cmd+` and Cmd+Shift+` switch the current window to the next (or previous) window of the current application

Keyboard-based window layout management

Using the mouse is bad for navigating windows, it is worse for managing their layout. Install Hammerspoon and either install a "spoon" (that's what they call extensions) like MiroWindowsManager2 or download my custom configuration3 and adapt it to your needs. Whichever solution you choose, the result is that you can now move to windows next to each other with lighting speed with a couple keystrokes and the windows will sit perfectly next to each other without overlapping.

Let's say I want to move VSCode next to iTerm:

Cmd+Tab (repeat until I am on VSCode) ... Cmd+Opt+Ctrl+m ... <- ... Cmd+Tab (repeat until I am on iTerm) ... Cmd+Opt+Ctrl+m ... ->

The key combos may look gross, but once they become muscle memory, you'll navigate and manage windows so quickly, you won't want to go back!

macos (4) productivity (11) tools (9) automation (1)

Social

3 Likes

Shoshin Manager 🚢 David Hammerspoon

Mention this post from your site:


Except where otherwise noted, content on stephanhagemann.com is licensed under CC BY 4.0 by Stephan Hagemann