Sketch Fu: custom keyboard shortcuts
Sketch Fu is a series of articles that aim to help you — product designer and Sketch user — work faster, smoother, and better.

Custom App Shortcuts is a little known, but handy feature of macOS. I use my keyboard instead of my cursor whenever possible because it saves me a ton of effort in the long run — keyboard shortcuts extend my productivity.
In this example, I’ll show how we can create some custom shortcuts, and then I’ll use them to create a symbol with constraints.
Setting the foundation

Here’s my UI element. There’s some empty space in the artboard I’d like to get rid of. I could manually resize the artboard with my cursor, or I could use Resize to Fit Content from the Layer menu.

These methods might work for you if you use this feature infrequently.
But if you use it frequently, wouldn’t it be neat if you could use a keyboard shortcut instead?
Creating your first keyboard shortcut
You can create a keyboard shortcut for any item in any menu for any app.
Head over to System Preferences, to Keyboard, to the Shortcuts tab, and to App Shortcuts.

Hit the “+” icon to add a new shortcut. Choose “Sketch” as the Application. For the Menu Title, be sure to type in exactly the same text we saw earlier in the menu. In this case, it’s Resize to Fit Content.
Enter a keyboard shortcut that works for you. Bear in mind that if you enter a shortcut that already exists for something else in Sketch, this will override it. For me, “Shift+Cmd+F” (⇧ ⌘ F) works.

Hit Add and we’re done.
Now in Sketch, the shortcut “Shift+Cmd+F” will resize artboards to neatly fit their contents.

Creating the symbol
Now, we need to make this artboard a symbol.

Observe that I’ve already created “Shift+Cmd+1” (⇧ ⌘ 1) as a keyboard shortcut for this. Once you create a custom shortcut, it also shows up in the menu item.
Adding constraints
I’ll assume the basics of constraints are clear. If not, no worries, check out the Constraints section in this article, or head over to Sketch’s official documentation.
I want to add constraints to make sure the red element always stays on the top right corner.


I usually do it from the Resizing menu, but guess what? It’s in the menu bar as well. Go to Layer, and then Constraints. This means that we can add shortcuts to make this a lot easier.
Observe that I’ve added “Control” (⌃) and “Cmd” (⌘) as the modifier keys for all my shortcuts, and logically named all of them.
To add constraints such that the red dot always stays in the top right corner, we need to add these constraints:
- Pin Top (⌃ ⌘ ↑)
- Pin Right (⌃ ⌘ →)
- Fix Width (⌃ ⌘ W)
- Fix Height (⌃ ⌘ H)
Here’s where carefully named shortcuts come in handy. I can hold down “Control” (⌃) and “Cmd” (⌘) and execute all the constraints effortlessly.

All without touching the mouse.
Using the keyboard exclusively is a recurring theme in Sketch Fu articles. Check out the other articles in the series.