Available in version 3.4 or later.
You can add new keyboard shortcuts or reassign an existing shortcut to a different command.
To customize keyboard shortcuts:
- use the
Settings/Advanced Options...menu (or open the Command Palette withCtrl + K, typeadvto narrow the results, and select theAdvanced Options...command) - this opens the advanced settings file in Notepad
- find the
Shortcutsarray and add new shortcut definitions
An example of customization:
Shortcuts [
[
Cmd = CmdOpen
Key = Alt + o
]
[
Cmd = CmdNone
Key = q
]
[
Name = Create green highlight
Cmd = CmdCreateAnnotHighlight #00ff00
Key = a
]
[
Cmd = CmdNextTab
ToolbarText = Next Tab
]
]
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+: the simplest way to get the old behavior back is setting
CtrlTabSimple = true in advanced settings. You can also 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.Explanation of the first example:
- by default, SumatraPDF uses the
Ctrl + Oshortcut for theCmdOpen(open a file) command. This changes the shortcut toAlt + O - by default,
qcloses the document. Binding it toCmdNonedisables that built-in shortcut - ver 3.6+:
CmdCreateAnnotHighlighttakes a color argument (#00ff00is green). We reassignato create a green highlight annotation (instead of the default yellow) - ver 3.6+:
Nameis optional. If provided, the command will appear in the command palette (Ctrl + K)
Format of the Key section #
- 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 - there are some special keys (e.g.
Alt + F3)F1-F24numpad0-numpad9:0to9but on 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 + Ato select uppercaseA
Global shortcuts #
Ver 3.7+: prefix
Key with Global to register a system-wide global 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.
- For commands that require a window or document, the command is dispatched to the most recently activated open window. If that window is closed, it falls back to the previously active open window. Triggering the global shortcut does not steal focus or bring background windows to the foreground.
- If SumatraPDF fails to register a global shortcut (e.g. if another program has already registered it), a warning notification is shown.
Commands #
You can see a full list of commands (or view them in the source code).
Escaping in settings values #
String values in the advanced settings file use
$ as an escape character.
A literal $ must be written as $$. A lone $ at the end of a value is
treated as 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.Notes #
The changes are applied as soon as you save the settings file, so you can test them without restarting SumatraPDF.
If a custom
Shortcut doesn’t work, it could be caused by an invalid command name or invalid command arguments.We log information about unsuccessful shortcut parsing, so check the logs if things don’t work as expected.