Add new keyboard shortcuts, reassign existing ones to a different command, or disable them, using the
Shortcuts advanced setting.Available in version 3.4 or later.
Most people use it to rebind a key to a different command. At a glance:
- Rebind a key:
Cmd+Keyin theShortcutsarray. - Disable a built-in shortcut: bind the key to
CmdNone. - Command with an argument (ver 3.6+): e.g.
CmdCreateAnnotHighlight #00ff00. - Command Palette entry (ver 3.6+): add
Name. - Global shortcut (ver 3.7+): prefix
KeywithGlobalto work when SumatraPDF isn’t focused. - Toolbar button: add
ToolbarText, see Customize toolbar.
Add or change a shortcut #
- Open the settings file:
- Menu: Settings → Open Advanced Settings File…
- Command Palette:
Ctrl + K, thenOpen Advanced Settings File...
- It opens in your default text editor. Find the
Shortcutsarray and add definitions. - Save. Changes apply immediately, no restart needed.
Example:
Shortcuts [
[
Cmd = CmdOpenFile
Key = Alt + o
]
[
Cmd = CmdNone
Key = q
]
[
Name = Create green highlight
Cmd = CmdCreateAnnotHighlight #00ff00
Key = a
]
[
Cmd = CmdNextTab
ToolbarText = Next Tab
]
]
- by default,
Ctrl + OrunsCmdOpenFile(open a file). This changes it toAlt + O - by default,
qcloses the document. Binding it toCmdNonedisables that built-in shortcut - ver 3.6+:
CmdCreateAnnotHighlighttakes a color argument (#00ff00is green). This reassignsato create a green highlight annotation (instead of the default yellow) - ver 3.6+:
Nameis optional. If provided, the command appears in the command palette (Ctrl + K)
Add a global shortcut #
Ver 3.7+: prefix
Key with Global to register a system-wide shortcut that works even when SumatraPDF does not have focus:Shortcuts [
[
Cmd = CmdGoToNextPage
Key = Global PageDown
]
[
Cmd = CmdScreenshot
Key = Global Alt+PrtSc
]
]
- To avoid hotkey conflicts, global shortcuts are only registered by the first running SumatraPDF instance.
- Commands that need a window or document go to the most recently activated open window. If it’s closed, the previously active open window is used. The shortcut does not steal focus or bring background windows to the foreground.
- If registering fails (e.g. another program already registered it), a warning notification is shown.
Restore pre-3.6 Ctrl+Tab (no Smart Tab Switch popup) #
Ver 3.6+ binds
Ctrl + Tab / Ctrl + Shift + Tab to Smart Tab Switch (CmdNextTabSmart / CmdPrevTabSmart), which shows a tab list while Ctrl is held. In 3.5 those keys switched tabs immediately in strip order (CmdNextTab / CmdPrevTab).Ver 3.7+: simplest is
CtrlTabSimple = true in advanced settings. Or rebind the keys:Shortcuts [
[
Cmd = CmdNextTab
Key = Ctrl + Tab
]
[
Cmd = CmdPrevTab
Key = Ctrl + Shift + Tab
]
]
Ctrl + PageDown / Ctrl + PageUp already run next/prev tab without the popup. More detail: Tabs and windows.Tips #
- Test changes without restarting: they apply as soon as you save the settings file.
- If a shortcut doesn’t work, check the command name and arguments; parse failures are logged, so check the logs.
- Use
CmdNoneto free a key before reusing it elsewhere. - Bind
CmdCommandPaletteFavorites/CmdCommandPaletteTOC, notCmdCommandPalette $/CmdCommandPalette %(see escaping below).
Format of the Key value #
- just a key (such as
a,Z, or5), i.e. the lettersatozandAtoZ, and the numbers0to9 - modifiers + key. Modifiers are
Shift,Alt,Ctrl, andAltGr(alsoRAlt/RightAlt), e.g.Alt + F1,Ctrl + Shift + Y, orAltGr + Return. On Windows,AltGris the same asCtrl + Alt - special keys (e.g.
Alt + F3):F1-F24numpad0-numpad9:0to9on a numerical keyboardDelete,Backspace,Insert,Home,End,EscapeLeft,Right,Up,Downfor arrow keys- full list of special keys
- without modifiers, case matters, i.e.
aandAare different - with modifiers, use
Shiftto select uppercase, i.e.Alt + ais the same asAlt + A; useAlt + Shift + Afor uppercaseA
Escaping in settings values #
String values in the advanced settings file use
$ as an escape character. Write a literal $ as $$. A lone $ at the end of a value is a trailing-whitespace marker, not a dollar sign.This matters for
CmdCommandPalette mode arguments: use CmdCommandPaletteFavorites (or CmdCommandPaletteTOC for table of contents) instead of CmdCommandPalette $ / CmdCommandPalette % when binding shortcuts.Commands #
See the full list of commands (or in the source code).
See also #
- Commands — command ids to bind
- Customize toolbar — buttons via
ToolbarText/ToolbarSvgIcon - Command Palette — where
Named shortcuts show up - Tabs and windows — tab switching keys
- Advanced settings — all settings