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
]
]
Explanation:
- 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)
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.