macOS Keyboard Shortcuts for Arranging your Windows
Published: 2022-05-18 20:44:38

If you're a developer, or anyone who spends most of their day typing away at the computer, chances are good that you have your own personal set of keyboard shortcuts that are your go-to's. I'm here to share with you one of my personal favorites in terms of global quality of life improvements, and how you can get it set up on your macOS computer.

## Arranging Windows with Keyboard Shortcuts

**The Goal:** change the positioning/sizing of a window or windows without ever touching the mouse

**Our Limitations:** repositioning and resizing windows (regardless of application) is possible on Mac, but only the specified options below. For any more nuanced repositioning of your workspace using the keyboard, you may need to look into downloading software specifically for the task.

**How We'll Do It:** The way we make this work is by using the ability to create custom keyboard shortcuts on macOS, and by using the pre-existing commands that mac has for positioning windows, which you can see by hovering over the green button (often called the "maximize" button) at the top left of any open window, as seen below:


![cursor hovering over the green maximize button on a window, displaying the following options in a list: Enter Full Screen, Zoom, Tile Window to Left of Screen, Move Window to Left Side of Screen, Tile Window to Right of Screen, Move Window to Right Side of Screen, and Move to DELL U2518D](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6y9fke4o6bn6a7l4wjs8.png)

Note that the commands shown here change contextually, and may appear differently for you.

## Creating the Shortcuts

To create our keyboard shortcuts, start by going to your mac's keyboard settings. You can do this quickly (using shortcuts!) by pressing CMD + SPACE to open the search bar, typing "keyboard", and pressing RETURN when the keyboard settings option shows up.

From here, click the "Shortcuts" tab option.


![The Keyboard Settings tabs with the central "Shortcuts" tab indicated](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/c9fz4t4gh1v8aj5xo0gz.png)

From here, select "App Shortcuts" from the list on the left. This will display your App-level keyboard shortcuts on your machine, there may be one or two already here.


![The Keyboard Shortcuts page, with "App Shortcuts" selected from the list on the left, and a number of shortcuts listed on the right under the sections "All Applications" and "Google Chrome"](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5ei64kbsdwt73542s3rm.png)

Finally, press the + button to create a new shortcut, and fill in the entries as follows:

- **Application:** select "All Applications". This will mean that the shortcut(s) we are creating will be accessible regardless of the application we are using.
- **Menu Title:** enter the name of the command you wish to map to the keyboard shortcut _exactly as it appears in the menu_. This must be a character-for-character match in order to work. Note that if you use multiple screens like me, each screen will have a specific name you must use in order to move windows to that screen, so when in doubt, check how it is listed!
- **Keyboard Shortcut:** Enter the shortcut you wish to use. It is a good idea to use shortcuts that are unlikely to be in use by any other application (you can see the shortcuts I use in the screenshots above).

And that is all there is to it! You should now be able to use your custom keyboard shortcuts to move, tile, fullscreen, and/or zoom your windows.

## Notes and Troubleshooting

It may sometimes be impossible to find a series of keyboard combinations that are unused by all of the applications you frequent, and you will probably find that application-level keyboard shortcuts override anything you set here (usually a good thing!).

In these cases, your options might be to list multiple keyboard shortcuts for the same command, and ensure that the backup shortcut works in the application you are trying to use.

My preferred solution however is often to see if the application in question will give me control over its keyboard shortcuts, and alter the conflicting shortcut(s) to be different (assuming I don't need the native shortcut of course!).

I personally did this in VS Code for the shortcuts in the images above for moving windows from one side of the screen to the other. It's all about finding which solution is best for your personal workflow.