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

Commands

Type them after : (or Ctrl+K). Tab/Shift+Tab, ↑/↓ or Ctrl+N/Ctrl+P pick an entry, Enter runs it (a command that still needs its argument is completed instead), Esc or Backspace on an empty line closes. Text that is not a command searches the actions by name. A command that cannot run shows an error and the line stays open.

Editor commands (from the editor, : starts the line with '<,'> in Visual mode and with .,.+2 after a count of 3, as Vim does; the command runs in the active tab’s editor):

  • A line range alone goes to its last line (the first non-blank): :12, :$, :+3, :-, :'a. Addresses are a number, ., $, 'x (a mark: 'a-'z, '<, '>, '', '.), each with +n / -n; a,b, a;b (the second counted from the first) and % (every line).
  • :[range]s/pattern/replacement/[flags] (:substitute) replaces in the range’s lines (the cursor’s line without one) as one undo step; the cursor goes to the last line changed. The pattern is a Rust regular expression, as in search (an empty one is the last search’s), and becomes the last search. The replacement is Vim’s: & or \0 the match, \1-\9 a group (an absent one is empty), ~ the previous replacement, \r a line break (\n too; in Vim it is a NUL), \t a tab, \u \l the next character upper or lower case, \U \L up to \E or \e, a backslash before any other character that character (\&, \~, \\, the delimiter); $1 is plain text. Flags: g (every match in a line), i / I (ignore case, or not), e (no error when nothing matches), & first (the last flags again); c (confirm) is not supported and says so. Any delimiter that is not a letter, digit, blank, \, " or | works (:s#a/b#c#). :s alone and :& repeat the last :s without its flags, :&& with them. Nothing matched: “Pattern not found”.
  • :[range]format formats the range’s lines (:'<,'>format, :%format); :format without a range, and Space e f (editor.format), format the statement under the cursor or the Visual selection. The formatter is never run on its own. It changes only the layout: where lines break, the indent ([editor] format_indent) and, if asked, the case of keywords ([editor] format_keyword_case). Names, strings, comments and dollar-quoted bodies stay as written. When its result would differ in anything else (an operator written apart, strings joined across a line break, U&'…', a psql \command) it changes nothing and says on which line. One format is one undo step.

An editor command closes the line; what went wrong is said in the status bar.

CommandAliasesDescription
:conn <profile>:connectConnect to a profile
:set <setting>=<value>Change a setting
:help:hKeyboard help
:runRun statement under cursor
:cancelCancel running query
:quit:qClose the tab (on the last tab: quit)
:qall:qa :quitallQuit
:w [name]:writeSave (a console asks for a name; with a name: save as)
:wq [name]:xSave, then close the tab (on the last tab: quit)
:e [name]:editOpen a saved query
:tabnewNew console tab
:tabcloseClose tab
:tabs:ls :buffersList tabs
:tabmove [N / +N / -N / $]:tabmMove this tab (:tabmove N: after tab N, 0 first; +N / -N: N places; alone: last)
:recoverBring back a closed console (also from earlier runs)
:settingsOpen the settings
:copy <format>Copy the selected range, or every fetched row, as… (:copy <format> [selection|all])
:use [db][.schema]Choose this tab’s database and schema
:nohlsearch:noh :nohlClear the search highlight in the editor (until the next search) and end the result grid’s search
:suspend:sus :stopSuspend datarig (the shell’s fg brings it back)
:formatFormat the statement under the cursor or the selection (only its layout)
:ddl [schema.name]Show the DDL of the explorer’s object, the table tab’s table, or a name (:ddl [schema.name])
:monitor [profile]Open the server monitor of the explorer’s or the active tab’s connection, or of one by name (:monitor [connection])
:explain [analyze]The plan of the statement under the cursor (:explain analyze runs and measures it; a write is rolled back)
:theme copy <from> <name> / new <name> / update [<name>]Write a theme file: a full copy of a theme, a new one to fill in, or the tokens a file does not list
:export [format] [all / fetched / selection] [delim= quote= header= null=] [path]Export the result to a file: alone, the export dialog; else every row by default, the format from the file’s extension (:export [format] [all|fetched|selection] [delim=… quote=… header=… null=…] [path])
:commitCommit the open transaction
:rollback:rbRoll back the open transaction
:txWhat the open transaction did
:session:startupWhat a profile’s sessions start with, and where each setting comes from
:changesShow changes
:applyApply the pending changes (asked first)
:discardDrop every pending change of the result
:whatsnewWhat’s new: the release notes of this version and the ones before
:updateUpdate: what the update check knows, and how to update

Settings of :set (saved to config.toml like the matching actions):

SettingValuesDescription
languageen ko autoUI language
iconson off autoNerd Font icons
secrets.default_sourceauto keychain file command env promptPassword storage of new profiles
commands.positionpopup bottomCommand line position
detail_viewpanel statusbarCell detail
clipboardauto system osc52Clipboard
copy_headerauto on offColumn names in copies
editor.cursor_shapeon offCursor shape
editor.clipboardon offYanks to the clipboard
themeterminal dark light high-contrast catppuccin catppuccin-latte catppuccin-mocha tokyo-night tokyo-night-day tokyo-night-night gruvbox gruvbox-light gruvbox-dark nord dracula or the name of a theme fileTheme
editor.format_keyword_casepreserve upper lowerFormatter: keywords
editor.format_indent4 2Formatter: indent
editor.auto_pairsoff onAuto-pairs
editor.soft_tab_backspaceon offBackspace to tab stop
editor.run_hintson offRun hints
secrets.macos_keychain_accessdirect security_toolmacOS keychain access
explorer.size_heat3 5 offExplorer: size colours
ui.yank_flashon offFlash copied cells
ui.changes_viewlist sqlChanges tab view
edit.paste_null\N NULL nonePaste NULL token
ui.tipsalways until_used offTips
ui.backgroundtheme terminalBackground
idle_disconnectoff 5m 10m 30m 1hClose idle connections
lock_waitoff 5s 10s 30s 1mLock wait limit
editor.completion_delay_ms60 0 30 100 150 250Completion delay (ms)
updates.checkon offCheck for updates
updates.whats_newon offWhat’s new
copy_formattsv csv json json_pretty markdown html xml insertFormat of y and Y copies
monitor.interval1s 2s 5s 10s 30s 60sServer monitor interval