Keyboard shortcuts
REPL
The REPL uses Emacs-style editing by default; set vi = true or press F4 for vi mode.
| Key | Does |
|---|---|
| Enter | Run the buffer if the statement is finished (ends with ; or \G, or is a special command); otherwise start a new line |
| Alt+Enter | Run the buffer now, finished or not |
| Tab | Take the highlighted suggestion, or open the completion menu |
| Shift+Tab | Previous suggestion |
| Ctrl+Space | Open the completion menu |
| ↑ / ↓ | Move in the menu, or through lines and history |
| → | Accept the grey suggestion from history |
| Ctrl+R | Search history |
| Ctrl+C | Cancel the running query (at the server), or clear the line |
| Ctrl+D | Quit, on an empty line |
| Ctrl+L | Clear the screen |
| F2 | Toggle smart (context-aware) completion |
| F3 | Toggle multi-line mode |
| F4 | Toggle vi / Emacs editing |
TUI
F1 shows these inside quarry (type to filter), and the command palette (Ctrl+P) lists every action by name.
The keys under Everywhere and Query tab are the defaults: you can rebind them in the config, see Key bindings and vim mode. The keys inside each pane are fixed.
Everywhere
| Key | Does |
|---|---|
| Ctrl+P | Command palette |
| F1, ? | Shortcuts, filtered as you type (? doesn't work while typing in the editor) |
| Ctrl+O | Connection manager |
| Ctrl+T / Ctrl+W | New query tab (from the explorer: for the selected database) / close tab |
| Alt+← / →, Ctrl+PgUp / PgDn | Previous / next tab |
| Alt+1…9 | Go to tab 1–9 |
| F6 / Shift+F6 | Move focus: explorer → editor → results |
| Alt+0 | Focus the explorer |
| Ctrl+B | Show or hide the explorer |
| Ctrl+G | Go to a table (fuzzy search) |
| Ctrl+Y | Theme picker (outside the editor, where it's redo) |
| Ctrl+R | History |
| Ctrl+Q | Quit |
Query tab
| Key | Does |
|---|---|
| Ctrl+Enter, Ctrl+E, Alt+Enter | Run the selection, or the statement under the cursor |
| F5, Ctrl+Shift+Enter | Run everything in the editor |
| Esc, Ctrl+C (while running) | Cancel the query |
| F7 / Shift+F7 | Explain / explain analyze |
| Alt+F | Format the SQL |
| Ctrl+S | Save as a favourite |
| Ctrl+X | Export results to a file (outside the editor, where it's cut) |
| Ctrl+↑ / ↓ | Resize the editor / results split |
Editor
| Key | Does |
|---|---|
| Arrows, Shift+arrows | Move, select |
| Ctrl+← / → | Move by word |
| Home / End | Start of text (then column 0) / end of line |
| Ctrl+Home / End | Start / end of the editor |
| Ctrl+Space | Completion (it also opens as you type) |
| Tab / Shift+Tab | Indent / unindent (the selected lines) |
| Ctrl+A | Select all |
| Ctrl+C / X / V | Copy / cut / paste (system clipboard) |
| Ctrl+Z | Undo |
| Ctrl+Y, Ctrl+Shift+Z | Redo |
| Ctrl+D | Duplicate the line or selection |
| Alt+↑ / ↓ | Move lines up / down |
| Ctrl+/ | Comment or uncomment |
| Ctrl+Backspace, Ctrl+Delete | Delete a word left / right |
| Esc | Move focus to the results |
With vi = true the editor uses vim's modes and keys instead; see vim mode.
In the completion menu: ↓ / ↑ (or Ctrl+N / P) move, Tab or Enter accept, Esc closes.
Results and grids
| Key | Does |
|---|---|
| h j k l, arrows | Move (Shift extends the selection) |
| PgUp / PgDn, Ctrl+U / D | Page / half page |
| g / G | First / last row |
| 0 / $, Home / End | First / last column |
| w / b | A screen of columns right / left |
| Tab / Shift+Tab | Next / previous cell |
| v / V | Select a block / whole rows |
| Enter | View the cell and its row (double-click works too) |
| y / Y | Copy cells as TSV / copy rows with a header |
| /, n, N | Search, next, previous |
| < / > / = | Narrow / widen / auto-fit the column |
| [ / ] | Previous / next result set |
| m | Messages |
| i | Back to the editor |
| Ctrl+X | Export to a file |
Table view
| Key | Does |
|---|---|
| f | Filter with a WHERE condition |
| F | Filter by the current cell's value |
| Esc | Clear the filter |
| s | Sort by the column (ascending, descending, off) |
| e, F2 | Edit the cell (\N for NULL) |
| o | Add a row |
| D, Delete | Mark rows for deletion |
| Ctrl+S | Review and apply staged changes |
| u | Discard staged changes |
| r, F5 | Reload |
Explorer
| Key | Does |
|---|---|
| j / k, arrows | Move |
| → / l, ← / h, Space | Expand, collapse, toggle |
| Enter | Open a table, show a function, insert a column name, or switch database |
| c | New query console for the database or schema you're in |
| s | Table structure |
| i | Insert the name into the editor |
| g + s / i / u / d / c / x / n | Write a SELECT / INSERT / UPDATE / DELETE / CREATE / DROP / COUNT |
| / | Filter the tree |
| r, F5 | Reload the schema |
| n | New connection |
| Ctrl+X | Disconnect |
Other tabs
| Tab | Keys |
|---|---|
| Structure | Tab / ] and Shift+Tab / [ change section, 1–7 jump to one. In DDL: y copies, e opens it in an editor. |
| Activity | p or Space pauses refreshing, r refreshes, K kills the selected session, Enter shows details |
| Explain | j / k select a plan node; details show below |
| History | Type to filter, Enter opens the statement in a new tab |
| Definition | y copies, e opens it in an editor |
Dialogs and prompts
| Key | Does |
|---|---|
| Enter, y | Confirm |
| Esc, n, q | Cancel |
| Ctrl+U / Ctrl+K | Delete to start / end of the input |
| Ctrl+W | Delete a word |
Connections
| Key | Does |
|---|---|
| Enter, click | Connect to the selected saved connection (or go to it, if it's open) |
| j / k, arrows, wheel | Move |
| n, Tab | New connection form |
| d | Delete the selected connection (no confirmation) |
| Esc | Close |
In the new-connection form:
| Key | Does |
|---|---|
| Tab / ↑ ↓ | Move between fields |
| ← / →, Space | Change the type or TLS mode, tick read-only |
| Enter | Connect (from a text field), or use the Connect button |
| Esc | Back to the list |
Mouse
With mouse = true (the default):
| Do | To |
|---|---|
| Click | Focus a pane; pick a tab, result set, tree item, cell, list item or button |
| Double-click a cell | View it |
| Click a column header in a table view | Sort by it |
| Middle-click a tab | Close it |
| Drag in the editor or grid | Select |
| Drag the explorer's edge or the editor/results border | Resize |
| Wheel | Scroll; in lists, move the selection. Shift+wheel scrolls the grid sideways. |
| Click outside a dialog | Close it |