/

Keybindings

The .keybinding {keys} docs ↗ function displays a keyboard shortcut or key combination.

Example 1

Press .keybinding {Mod+K} to trigger the action.

Press CtrlK to trigger the action.

Keys are separated by +, ,, or - delimiters.

On macOS, modifier keys automatically display their native symbols (e.g. Command instead of Ctrl).

If you’re on macOS right now, you can notice the difference in the above example: the first keybinding displays as Ctrl K on other platforms, but as ⌘ K on macOS.

Modifiers

The following modifier names are recognized (case-insensitive):

InputDefault displaymacOS display
cmd, command, meta, modCtrl
ctrl, controlCtrl
alt, optionAlt
shiftShift

Any other key name is displayed as-is, capitalized.

Example 2

.keybinding {Cmd+Alt+Tab}
CtrlAltTab

Example 3

.keybinding {Alt+F4}
AltF4

Literal delimiter keys

Since +, ,, and - are reserved as delimiters, use their literal names to represent them as keys:

LiteralKey
plus+
comma,
dash, minus-
dot, period.

Example 4

.keybinding {Ctrl+plus}
Ctrl+

Example 5

.keybinding {Ctrl+dot}
Ctrl.