I am the Taco Bell of keyboard shortcuts: I’ve found a new way to combine the same ingredients.

There are a limited number of prime-real-estate global keyboard shortcuts, but may I now present to you: Command-Caps Lock.

It was sitting there right in front of our faces all along!

You may have already had the idea to reassign Caps Lock. Sure, everyone has. So under the hood, you remap it to F18. Now you can use Command-F18 as a global shortcut so easy it’s making Command-Tab jealous.

How to set it up

This is for macOS, but the idea works anywhere you can remap keys.

1. Turn Caps Lock into F18. macOS ships with hidutil, which can remap keys without any third-party software:

hidutil property --set '{"UserKeyMapping":[{"HIDKeyboardModifierMappingSrc":0x700000039,"HIDKeyboardModifierMappingDst":0x70000006D}]}'

0x700000039 is Caps Lock and 0x70000006D is F18. F18 is a good choice because almost nothing uses it, unlike F14 and F15, which macOS treats as brightness keys.

2. Make it stick. hidutil mappings reset when you reboot, so run that same command at login with a LaunchAgent. Save this as ~/Library/LaunchAgents/com.local.KeyRemapping.plist:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>Label</key>
    <string>com.local.KeyRemapping</string>
    <key>ProgramArguments</key>
    <array>
        <string>/usr/bin/hidutil</string>
        <string>property</string>
        <string>--set</string>
        <string>{"UserKeyMapping":[{"HIDKeyboardModifierMappingSrc":0x700000039,"HIDKeyboardModifierMappingDst":0x70000006D}]}</string>
    </array>
    <key>RunAtLoad</key>
    <true/>
</dict>
</plist>

Then load it with launchctl load ~/Library/LaunchAgents/com.local.KeyRemapping.plist.

3. Bind Command-F18 to something. No extra software needed here either. Make a shortcut in the Shortcuts app (open an app, run an AppleScript, whatever you like), then open its Shortcut Details, click Add Keyboard Shortcut, and press Command-Caps Lock. macOS will record it as Command-F18. Any app that lets you record a global hotkey, like Raycast or Alfred, works the same way.