How to Create Custom Keyboard Shortcuts on Mac/Windows

Why Create Custom Shortcuts

Default keyboard shortcuts cover the most common actions, but every person's workflow is different. Custom shortcuts let you assign key combinations to the commands you use most, eliminate repetitive mouse movements, and build muscle memory around your specific tasks. Whether you are writing code, editing documents, or managing files, a personalized shortcut setup can save significant time over the course of a workday.

Creating Custom Shortcuts on Mac

Using System Preferences

macOS has a built-in system for adding keyboard shortcuts to any menu bar command in any application. This works without installing third-party software.

  1. Open System Preferences (or System Settings on macOS Ventura and later) and select Keyboard.
  2. Click the Keyboard Shortcuts tab (or Keyboard Shortcuts button in newer versions).
  3. In the left sidebar, select App Shortcuts.
  4. Click the + button below the shortcut list.
  5. Choose the target application from the Application dropdown. Select All Applications to make the shortcut global.
  6. In the Menu Title field, type the exact name of the menu command you want to trigger. This must match the menu item text precisely, including capitalization and any ellipsis characters.
  7. Click the Keyboard Shortcut field and press the key combination you want to assign.
  8. Click Add. The shortcut is active immediately.

For example, to assign Ctrl + Shift + M to the "Merge All Windows" command in Safari, you would enter "Merge All Windows" as the menu title and press that key combination in the shortcut field.

Modifying Built-in Shortcuts

The same Keyboard Shortcuts panel lets you override existing system shortcuts. Under categories like Mission Control, Spotlight, and Accessibility, you can double-click any shortcut value and press a new key combination to replace it. Uncheck the box next to a shortcut to disable it without removing the assignment.

Using Automator for Complex Actions

When a simple menu command is not enough, Automator lets you build multi-step workflows and assign them to keyboard shortcuts through the Services menu.

  1. Open Automator and create a new Quick Action (called "Service" in older versions).
  2. Set the Workflow receives dropdown to the appropriate input type, or select no input if the action is self-contained.
  3. Build your workflow by dragging actions from the library. For example, you could combine "Get Selected Finder Items," "Copy Finder Items," and "Reveal Finder Items" to create a one-step file duplication action.
  4. Save the workflow with a descriptive name.
  5. Open System Preferences > Keyboard > Keyboard Shortcuts > Services. Find your new service in the list and assign a key combination by double-clicking the shortcut column.

Quick Actions created in Automator also appear in the Finder's Quick Actions menu and the Touch Bar, giving you multiple ways to trigger them.

Using Shortcuts App

On macOS Monterey and later, the Shortcuts app provides a more modern alternative to Automator. You can create automations with a visual interface and assign keyboard shortcuts to them.

  1. Open the Shortcuts app and click + to create a new shortcut.
  2. Add actions by searching the action library on the right side.
  3. After saving, right-click the shortcut in the list and select Add Keyboard Shortcut.
  4. Press the desired key combination and confirm.

Creating Custom Shortcuts on Windows

Using Shortcut Properties

Windows allows you to assign a key combination to any desktop shortcut or Start Menu shortcut. This is the simplest method and requires no additional software.

  1. Locate or create a shortcut to the application or file you want to launch. Desktop shortcuts and shortcuts in the Start Menu folders work for this purpose.
  2. Right-click the shortcut and select Properties.
  3. Click in the Shortcut key field and press a key combination. Windows automatically prepends Ctrl + Alt to whatever key you press, so pressing T assigns Ctrl + Alt + T.
  4. Click Apply and then OK.

This method only works for launching applications and opening files or folders. It cannot assign shortcuts to specific commands within an application.

Using AutoHotkey

AutoHotkey is a free, open-source scripting language for Windows that gives you complete control over keyboard shortcuts. It can remap keys, trigger multi-step actions, expand text, and automate nearly any task.

  1. Download and install AutoHotkey from the official website.
  2. Create a new text file with the .ahk extension.
  3. Write your hotkey definitions using AutoHotkey syntax. Each definition starts with the key combination, followed by a double colon, and then the action to perform.
  4. Double-click the .ahk file to run it. An icon appears in the system tray indicating the script is active.

Some useful examples of AutoHotkey syntax:

To open Notepad with Ctrl + Alt + N, the script line would be ^!n::Run notepad.exe. The caret represents Ctrl, the exclamation mark represents Alt, and the lowercase letter is the base key.

To type a frequently used phrase with a shortcut, use ::addr::123 Main Street, Anytown which expands the abbreviation "addr" into the full address as you type.

To make a script run automatically at startup, place the .ahk file (or a shortcut to it) in your Startup folder. Open the Startup folder by pressing Win + R and typing shell:startup.

Using Microsoft PowerToys

PowerToys is a free utility set from Microsoft that includes a Keyboard Manager for remapping keys and shortcuts without writing any code.

  1. Install PowerToys from the Microsoft Store or from the GitHub releases page.
  2. Open PowerToys Settings and navigate to Keyboard Manager.
  3. To remap a single key, click Remap a key and set the source and target keys. For example, you can remap Caps Lock to Esc.
  4. To remap a shortcut, click Remap a shortcut. Set the source shortcut (the keys you want to press) and the target shortcut (the action you want to trigger). You can scope remappings to specific applications by entering the executable name in the Target App field.
  5. Click OK to apply. Changes take effect immediately.

PowerToys Keyboard Manager is particularly useful for people who switch between Mac and Windows, as it can remap modifier keys to match the layout you are accustomed to.

App-Level Shortcut Customization

VS Code

Visual Studio Code has one of the most thorough shortcut customization systems of any application.

  1. Open the Command Palette with Ctrl + Shift + P (Windows/Linux) or Cmd + Shift + P (Mac).
  2. Type "Preferences: Open Keyboard Shortcuts" and select it. This opens a searchable list of every available command and its current binding.
  3. Search for the command you want to modify. Click the pencil icon next to it and press the new key combination.
  4. For advanced configurations, click the file icon in the top right to open keybindings.json. This file lets you define conditional shortcuts using the when clause, so a shortcut can behave differently depending on whether you are in an editor, a terminal, or a specific file type.

VS Code also supports chord shortcuts -- two-step key sequences where you press one combination followed by another. For example, Ctrl + K followed by Ctrl + C comments out selected lines. You can create your own chords in keybindings.json.

Chrome and Chromium Browsers

Chrome does not have a built-in shortcut editor, but you can customize shortcuts for extensions.

  1. Navigate to chrome://extensions/shortcuts in the address bar.
  2. Each installed extension that supports shortcuts will appear with configurable fields.
  3. Click the pencil icon next to the shortcut you want to change and press a new key combination.
  4. Use the dropdown to set the scope to "In Chrome" (active only when Chrome is focused) or "Global" (active system-wide).

For broader Chrome shortcut customization, extensions like Vimium or Shortkeys let you bind any key combination to browser actions such as opening bookmarks, switching tabs, or running JavaScript snippets on the current page.

Microsoft Office

In Word, Excel, and other Office applications, you can assign shortcuts to commands, macros, and styles.

  1. In Word, go to File > Options > Customize Ribbon and click Customize next to "Keyboard shortcuts" at the bottom.
  2. Select the category and command from the lists.
  3. Click in the Press new shortcut key field and enter your key combination.
  4. Check the "Currently assigned to" line to see if the combination is already in use.
  5. Click Assign to confirm.

Terminal and Shell

Most terminal emulators and shells support custom keybindings. In Bash and Zsh, you can add bindings to your .inputrc or .zshrc file. For example, adding bindkey '^[s' push-line to .zshrc binds Alt + S to the push-line command. Terminal applications like iTerm2, Windows Terminal, and Alacritty each have their own configuration files for defining shortcut schemes.

Best Practices for Choosing Key Combinations

Avoid Conflicts with System Shortcuts

Before assigning a new shortcut, check whether the combination is already in use at the OS level or in the application you are targeting. On Mac, the built-in Keyboard Shortcuts panel shows all active system shortcuts. On Windows, tools like PowerToys and AutoHotkey can help you audit existing bindings. Overriding a common shortcut like Ctrl + C will cause confusion and should almost always be avoided.

Use a Consistent Modifier Pattern

Pick a modifier combination that you reserve for your custom shortcuts and use it consistently. A common approach is to use Ctrl + Shift + Alt (Windows) or Ctrl + Shift + Option (Mac) as your personal prefix, since very few default shortcuts use all three modifiers together. This dramatically reduces the chance of conflicts.

Group Related Actions Logically

If you are creating several shortcuts for related tasks, use a common modifier pattern and vary the letter key. For example, if you create shortcuts for different build tasks, you might use Ctrl + Shift + Alt + B for build, Ctrl + Shift + Alt + T for test, and Ctrl + Shift + Alt + D for deploy. The shared prefix makes them easier to remember as a set.

Choose Memorable Key Associations

Use mnemonic letter choices whenever possible. Assign N for "new," D for "delete" or "deploy," S for "save" or "search." A shortcut you can recall intuitively is far more valuable than one you have to look up. If you run out of obvious letters, consider using chord shortcuts (two-step sequences) instead of obscure single-key combinations.

Document Your Custom Shortcuts

Keep a reference list of every custom shortcut you have created, organized by application or context. This is especially important if you configure shortcuts across multiple tools. A simple text file or spreadsheet works well. When you set up a new machine, this reference makes it straightforward to recreate your configuration, and it helps you spot potential conflicts before they cause problems.

Test Before Committing

After assigning a new shortcut, test it in several contexts. Make sure it works when the expected application is focused, and confirm it does not interfere with other applications. On Mac, some shortcuts behave differently depending on whether you are using a native app or a cross-platform one. On Windows, global AutoHotkey shortcuts can intercept keys from every application, so verify that common workflows in your other programs still function correctly.

Troubleshooting Common Issues

Shortcut Not Working

If a newly assigned shortcut does nothing when pressed, check these common causes:

  1. The menu title (on Mac) may not match exactly. Check for trailing spaces, special characters, or differences between a localized menu and the English name.
  2. Another shortcut at a higher priority level may be intercepting the key combination. System-level shortcuts take precedence over application-level ones.
  3. The application may need to be restarted for the change to take effect.
  4. On Windows, AutoHotkey scripts must be running for their shortcuts to work. Check the system tray for the AutoHotkey icon.

Shortcut Conflicts

When two shortcuts share the same key combination, the one with higher priority wins. The typical priority order from highest to lowest is: operating system shortcuts, global third-party shortcuts (such as AutoHotkey global hotkeys), application-specific shortcuts, and finally extension or plugin shortcuts within an application. To resolve a conflict, change the shortcut at the lower priority level, or disable the higher-priority shortcut if you do not need it.

Shortcuts Lost After Update

Operating system and application updates can occasionally reset custom shortcuts. To protect against this, export your configuration files when possible. AutoHotkey scripts are inherently portable since they are plain text files. VS Code keybindings can be synced via Settings Sync. On Mac, the custom shortcut definitions are stored in ~/Library/Preferences/.GlobalPreferences.plist and in app-specific preference files, which can be backed up.