Editor reference: shortcuts and tools

This page lists every keyboard shortcut in the Editor and what each toolbar button does. Use it to look up a key or a button while you write and run a query.

Open the full list in the Editor

  1. Point to the keyboard button in the editor toolbar. Its tooltip reads Keyboard Shortcuts.
  2. Click it. The Keyboard shortcuts window opens, grouped into Query, Search, Editing, Editor, Code, Navigation, Transform and Multi-cursor.
  3. Press Esc to close it.

Run and check a query

ActionShortcut
Execute queryCtrl+Enter
Save queryCtrl+S
Add parameterCtrl+P
Show suggestionsCtrl+Space
SQL intentions (refactor)Alt+Enter
Format SQL (not in the window, but it works)Ctrl+Shift+F

Ctrl+Enter runs a selection at once. Without a selection, it highlights the statement at the cursor and opens the Statements list, whose footer reads Enter run · ↑↓ choose · Esc cancel. Any other key, a click in the editor, or leaving the editor also cancels it. For what runs in each case, see Choose what runs.

Alt+Enter opens a list of quick rewrites, such as Expand column list. Enter applies the highlighted rewrite, the arrow keys choose, and Esc cancels. For what the helpers do, see Write and check SQL.

Move around the Editor

ActionShortcut
Toggle database explorerAlt+1
Toggle results panelAlt+2
Jump editor ↔ results gridF6
Go to column (in results grid)Ctrl+F12

In the editor, F6 moves focus to the results grid, to the cell you used last or the first cell. In the grid, F6 or Esc returns focus to the editor. These keys do not work while you type in a search or filter box in the grid. Ctrl+F12 in the grid opens a searchable list of the table's columns; choose one to scroll it into view. When a screen shows more than one grid, Ctrl+F12 acts on the grid under your pointer or the grid with focus. For the other grid keys, see The data grid.

Work with consoles

ActionShortcut
Next consoleCtrl+↓
Previous consoleCtrl+↑
New consoleCtrl+Shift+Q
Close current consoleAlt+X
Console historyCtrl+Shift+H

Closing a console removes it from the list, but it is kept. See Consoles, saving and history to reopen it.

Edit text

ActionShortcut
Comment lineCtrl+/
Duplicate lineCtrl+D
Move line upShift+Alt+↑
Move line downShift+Alt+↓
IndentTab
OutdentShift+Tab
UndoCtrl+Z
RedoCtrl+Shift+Z or Ctrl+Y
Open table in Lake/WHCtrl+B

Ctrl+B opens the Lake or Warehouse popup of the table under the cursor. If there is no table name at the cursor, the Editor shows No table name at cursor. For the popup, see Database Explorer.

Keys the window does not list

Find, go to and transform text

ActionShortcut
FindCtrl+F
ReplaceCtrl+H
Find nextF3
Find previousShift+F3
Go to lineCtrl+G
Fold / unfoldCtrl+K, then Ctrl+L
Fold allCtrl+K, then 0
Cut current lineCtrl+X
Copy current lineCtrl+C
To uppercaseCtrl+Shift+U
To lowercaseCtrl+U

When you move between matches, with Enter or Shift+Enter in the find bar, F3, or the arrow buttons, the line number of the match flashes briefly, so you can see where the jump landed. Typing a new search does not flash the line.

Edit several lines at once

ActionShortcut
Add cursor at clickCtrl+Click
Multi-editWheel click, or Ctrl+Alt+↑ and Ctrl+Alt+↓

Cues as you write

Use the toolbar buttons

The editor toolbar runs from left to right as follows. Most buttons have no label, so their tooltips name them.

ButtonWhat it doesShortcut
Play button (tooltip Run Query (Ctrl+Enter+Enter))Runs the query. It is greyed out while a query runs.Ctrl+Enter
Save (tooltip Save Query (Ctrl+S))Records the current text as a version in Console history. It is greyed out when the text matches the saved console text, with the tooltip No changes to save.Ctrl+S
Keyboard button (tooltip Keyboard Shortcuts)Opens the shortcut window.None
Braces button (tooltip Add Parameter (Ctrl+P))Adds a parameter to the query. See Query parameters.Ctrl+P
Format button (tooltip Format SQL (Ctrl+Shift+F))Formats the whole query; while it works, its tooltip reads Formatting SQL….Ctrl+Shift+F
Stop button (tooltip Stop Query)Stops a running query. It is greyed out when nothing runs.None
Undo button (tooltip Undo (Ctrl+Z))Undoes the last edit.Ctrl+Z
Redo button (tooltip Redo (Ctrl+Y))Redoes an undone edit.Ctrl+Y
Sparkle buttonTurns AI suggestions on or off. Its tooltip reads AI suggestions on - click to disable or AI suggestions off - click to enable.None

On the right of the toolbar:

Use the Results Panel buttons

The side bar of the Results Panel holds these buttons. Alt+2 shows or hides the panel.

Questions, answered

Why does the Run tooltip say Ctrl+Enter+Enter?

Ctrl+Enter first highlights the statement, so you can check it. Press Enter, or Ctrl+Enter again, to run it. A selected block runs at once, without this step.

How do I jump from the editor to the results and back?

Press F6 in the editor to move to the results grid. Press F6 or Esc in the grid to return to the editor.

How do I find a column in a wide result?

Click a cell in the grid, press Ctrl+F12, and type part of the column name. Choose the column to scroll to it.

Can I edit several lines at once?

Yes. Ctrl+Click adds a cursor where you click. Multi-edit also works with a wheel click, or with Ctrl+Alt+↑ and Ctrl+Alt+↓.

Can I change the shortcuts?

No. The shortcuts are fixed, and the Editor has no setting for them.

Do the shortcuts work on a Mac?

Yes, for most of them. Inside the editor, Cmd works in place of Ctrl for Execute query, Save query, Add parameter, Format SQL, Open table in Lake/WH, Next console, Previous console, New console and Console history. Alt+X closes the current console on a Mac too.

Why is Save greyed out?

Save is greyed out when no console is open or when the text in the editor matches the saved console text. Its tooltip then reads No changes to save. The Editor saves your text on its own about a second after you stop typing, so Save is usually greyed out soon after you stop. Each run also records a version when the text has changed. See Consoles, saving and history.

What does the bell button do?

It opens the alert editor with the current query filled in. See Create an alert. You need the Create Alerts permission to see the button. It is greyed out while the console is empty.

What does Escape do in the editor?

With more than one cursor, Escape collapses the cursors into the first one. With a single cursor, it closes the suggestion list and moves focus out of the editor; pressing Space closes an open suggestion list too.

Why does a line number flash while I use Find?

When you jump between matches, the line number of the match flashes briefly, so you can see where the jump landed. Typing a new search does not flash the line.