Available in version 3.4 or later.
You can add new keyboard shortcuts or re-assign existing shortcut to a different command.
To customize keyboard shortcuts:
- use
Settings/Advanced Options...menu (orCtrl + KCommand Palette, typeadvto narrow down and selectAdvanced Options...command) - this opens a notepad with advanced settings file
- find
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 openedit
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). To get the old behavior back: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 has
Ctrl + Oshortcut forCmdOpen(open a file) command. This changes the shortcut toAlt + o - by default
qcloses the document. By binding it toCmdNonewe can disable a built-in shortcut - ver 3.6+:
CmdCreateAnnotHighlighttakes a color argument (#00ff00is green) and booleanopeneditargument. We re-assignato create a highlight annotation with green color (different from default yellow) and to open annotations edit window (openeditboolean argument) - ver 3.6+:
Nameis optional. If given, the command will show up in command palette (Ctrl + K)
Format of Key section: #
- just a key (like
a,Z,5) i.e. lettersatoz,AtoZ, and numbers0to9 - modifiers + key. Modifiers are:
Shift,Alt,Ctrle.g.Alt + F1,Ctrl + Shift + Y - 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 does matter i.e.
aandAare different - with modifiers, use
Shiftto select upper-case i.e.Alt + ais the same asAlt + A, useAlt + Shift + Ato select the upper-caseA
Commands #
You can see a full list of commands (or 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 right after you save settings file so that you can test changes without restarting SumatraPDF.
If a custom
Shortcut doesn’t work it could be caused by invalid command name or invalid command arguments.We log information about unsuccessful parsing of a shortcut so check the logs if things don’t work as expected.