Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Keyboard shortcuts

On Linux and Windows, read Ctrl wherever this page says ⌘.

Defaults

ShortcutActionWorks while
⌘↵Run the selection, or the statement at the cursorthe console’s editor has focus
⇧⌘↵Run every statement in the consolethe editor has focus
⌥⌘EExplain the statement at the cursorthe editor has focus
⌘.Cancel the running statement, or discard rows not yet loadedthe editor has focus
⌃SpaceSuggest names and keywords at the cursorthe editor has focus
⌥⌘LFormat the selection, or the statement at the cursorthe editor has focus
⇧⌥⌘LFormat every statement in the consolethe editor has focus
F8Go to the next error or warningthe editor has focus
⇧F8Go to the previous error or warningthe editor has focus
⌘FFind in the consolethe editor or the find bar has focus
⌥⌘FFind and replace in the consolethe editor or the find bar has focus
⌘G, F3Go to the next matchthe editor or the find bar has focus
⇧⌘G, ⇧F3Go to the previous matchthe editor or the find bar has focus
⌘,Open the settingsalways
⌘OOpen a .sql file in a new consolealways
⌘SSave the console to its .sql filea console’s tab is selected
⇧⌘SSave the console to a new .sql filea console’s tab is selected
SpaceShow the selected cell’s whole valueno text field has focus
F2, EnterEdit the selected cellno text field has focus
⌘CCopy the selected cellsno text field has focus

Console shortcuts are taken before the editor sees them, so ⌘↵ runs a statement instead of inserting a new line. History, Commit and Rollback have no shortcut by default.

On a Mac the menu bar adds the keys every Mac app has: ⌘Q quits, ⌘H hides dbdesk, ⌥⌘H hides the other apps, ⌘M minimizes the window and ⌃⌘F enters full screen. They aren’t in keymap.toml.

Changing them

Shortcuts live in keymap.toml, next to data_sources.toml (see Where dbdesk keeps its files). View → Keymap… lists every action with its id, its shortcuts and what it does, and has two buttons:

  • Create keymap.toml writes a file listing every action with its default, commented out. It never replaces a file that exists.
  • Reload applies your edits without restarting dbdesk.

In the file, list only the actions you want to change:

[bindings]
"console.run" = "cmd+r"                    # one shortcut
"console.explain" = ["cmd+alt+e", "f5"]    # or several
"console.cancel" = []                      # or none

A shortcut is modifiers and a key joined by +, ignoring case. cmd is ⌘ on macOS and Ctrl elsewhere; ctrl is the Control key everywhere; alt (or option) and shift are what they say. Keys are letters, digits, enter, space, tab, escape, f1 to f35, period, comma, pagedown and so on, or the character itself (cmd+.).

Your own actions from actions.toml are bound the same way, as custom.<id>; see Actions, snippets and themes.

A mistake doesn’t cost you the rest of the file: an unknown action, a shortcut that can’t be read, or one that two actions share, is skipped and listed as a problem in the Keymap window, and the status bar shows keymap.toml: N problems. A file that isn’t valid TOML keeps every default and shows why.

Editing text

The SQL editor and the other text fields use the usual editing keys:

ShortcutAction
⌘ASelect all
⌘C, ⌘X, ⌘VCopy, cut, paste
⌘Z, ⇧⌘ZUndo, redo
⇧ with arrow keysExtend the selection
⌥← / ⌥→ (Ctrl on Linux and Windows)Move by word

Dialogs

Esc closes the data source dialog, the delete confirmation and the “Run anyway?” check without doing anything.