Query Editor Shortcuts

This page documents various keyboard shortcuts supported in the Query Editor page of the Rockset Console.

Below are some special shortcuts built into the Rockset Query Editor.

Special Rockset Query Editor Shortcuts

  • Ctrl-Alt-W: Close current query tab
  • Ctrl-Alt-T: Open new query tab
  • Ctrl-Alt-]: Switch to next query tab
  • Ctrl-Alt-[: Switch to previous query tab
  • Ctrl-Enter (Cmd-Enter on macOS): Run query
  • Ctrl-Shift-F (Cmd-Shift-F on macOS): Format query
  • Ctrl-Alt-S (Cmd-Alt-S on macOS): Save as Query Lambda

The Rockset query editor is built from CodeMirror. You can view the full CodeMirror key maps documentation here. Below are the keyboard shortcuts supported in the Rockset Query Editor.

Managing Selections
  • Alt-ArrowUp: Move the selected lines up one line.
  • Alt-ArrowDown: Move the selected lines down one line.
  • Shift-ArrowUp: Move the selection head one line up.
  • Shift-ArrowDown: Move the selection head one line down.
  • Shift-Alt-ArrowUp: Create a copy of the selected lines. Keep the selection in the top copy.
  • Shift-Alt-ArrowDown: Create a copy of the selected lines. Keep the selection in the bottom copy.
  • Cmd-ArrowUp (on macOS): Move the selection to the start of the document. (with Shift: Move the selection head to the start of the document.)
  • Cmd-ArrowDown (on macOS): Move the selection to the end of the document. (with Shift: Move the selection head to the end of the document.)
  • ArrowLeft: Move the selection one character to the left (with Shift: Move the selection head one character to the left, while leaving the anchor in place.)
  • ArrowRight: Move the selection one character to the right. (with Shift: Move the selection head one character to the right, while leaving the anchor in place.)
  • Ctrl-ArrowLeft (Alt-ArrowLeft on macOS): Move the selection to the left across one group of word or non-word (but also non-space) characters. (with Shift: Move the selection head one group to the left.)
  • Ctrl-ArrowRight (Alt-ArrowRight on macOS): Move the selection to the right across one group of word or non-word (but also non-space) characters. (with Shift: Move the selection head one group to the right.)
  • Cmd-ArrowLeft (on macOS): Move the selection to the start of the line. (with Shift: Move the selection head to the start of the line.)
  • Cmd-ArrowRight (on macOS): Move the selection to the end of the line. (with Shift: Move the selection head to the end of the line.)
  • Escape: Simplify the current selection. When multiple ranges are selected, reduce it to its main range. Otherwise, if the selection is non-empty, convert it to a cursor selection.
  • Alt-l (Ctrl-l on macOS): Expand the selection to cover entire lines.
  • Ctrl-i (Cmd-i on macOS): Select the next syntactic construct that is larger than the selection. Note that this will only work insofar as the language provider you use builds up a full syntax tree.
  • Ctrl-\[ (Cmd-\[ on macOS): Remove a unit of indentation from all selected lines.
  • Ctrl-] (Cmd-] on macOS): Add a unit of indentation to all selected lines.
  • Ctrl-Alt-\\ (Cmd-Alt-\\ on macOS): Auto-indent the selected lines.
  • Shift-Ctrl-k (Shift-Cmd-k on macOS): Delete selected lines.
  • Shift-Ctrl-\\ (Shift-Cmd-\\ on macOS): Move the selection to the bracket matching the one it is currently on, if any.
  • Ctrl-/ (Cmd-/ on macOS): Comment or uncomment the current selection. Will use line comments if available, otherwise falling back to block comments.
  • Shift-Alt-a: Comment or uncomment the current selection using block comments. The block comment syntax is taken from the commentTokens language data.
  • Enter with a selection: Replace the selection with a newline and indent the newly created line(s). If the current line consists only of whitespace, this will also delete that whitespace. When the cursor is between matching brackets, an additional newline will be inserted after the cursor.
  • Ctrl-a (Cmd-a on macOS): Select the entire document.
  • Backspace: Delete the selection, or, for cursor selections, the character before the cursor.
  • Delete: Delete the selection or the character after the cursor.
  • Ctrl-Backspace (Alt-Backspace on macOS): Delete the selection or backward until the end of the next group, only skipping groups of whitespace when they consist of a single space.
  • Ctrl-Delete (Alt-Delete on macOS): Delete the selection or forward until the end of the next group.
  • Cmd-Delete (macOS): Delete the selection, or, if it is a cursor selection, delete to the end of the line or the next line wrap after the cursor.
Managing Selections with Special Keys
  • PageUp: Move the selection one page up. (with Shift: Move the selection head one page up.)
  • PageDown: Move the selection one page down. (with Shift: Move the selection head one page up.)
  • Home: Move the selection to previous line wrap point, or failing that to the start of the line. If the line is indented, and the cursor isn't already at the end of the indentation, this will move to the end of the indentation instead of the start of the line. (with Shift: Move the selection head to the previous line boundary.)
  • End: Move the selection to the next line wrap point, or to the end of the line if there isn't one left on this line. (with Shift: Move the selection head to the next line boundary.)
  • Ctrl-Home: Move the selection to the start of the document. (with Shift: Move the selection head to the start of the document.)
  • Ctrl-End: Move the selection to the end of the document.(with Shift: Move the selection head to the end of the document.)
Autocomplete
  • Ctrl-Space: Explicitly start autocompletion.
  • Escape: Close the currently active completion.
  • ArrowDown: Returns a command that moves the completion selection forward or backward by the given amount.
  • ArrowUp: Returns a command that moves the completion selection forward or backward by the given amount.
  • PageDown: Returns a command that moves the completion selection forward or backward by the given amount.
  • PageDown: Returns a command that moves the completion selection forward or backward by the given amount.
  • Enter: Accept the current completion.
History
  • Mod-z (Cmd-z on macOS): Undo.
  • Mod-y (Cmd-Shift-z on macOS, Ctrl-Shift-z on Linux): Redo.
  • Mod-u (Cmd-u on macOS): Undo a change or selection change.
  • Alt-u (Alt-Shift-u on macOS): Redo a change or selection change.
Search
  • Mod-f (Cmd-f on macOS): Make sure the search panel is open and focused
  • F3, Mod-g (Cmd-g on macOS): Open the search panel if it isn't already open, and move the selection to the first match after the current main selection. Will wrap around to the start of the document when it reaches the end.
  • Shift-F3, Shift-Mod-g (Shift-Cmd-g on macOS): Move the selection to the previous instance of the search query, before the current main selection. Will wrap past the start of the document to start searching at the end again.
  • Mod-Alt-g (Cmd-Alt-g on macOS): Shows a dialog asking for a line number, and when a valid position is provided, moves the cursor to that line.
  • Mod-d (Cmd-d on macOS): Select next occurrence of the current selection. Expand selection to the surrounding word when the selection is empty.
Query Collapsing
  • Ctrl-Shift-\[ (Cmd-Alt-\[ on macOS): Fold the lines that are selected, if possible.
  • Ctrl-Shift-] (Cmd-Alt-] on macOS): Unfold folded ranges on selected lines.
  • Ctrl-Alt-\[: Fold all top-level foldable ranges.
  • Ctrl-Alt-]: Unfold all folded code.
Selecting Multiple Ranges
  • Ctrl-Click (Cmd-Click on macOS): Place multiple cursors
  • Alt-Shift-Drag: Make a discontinuous selection area across multiple lines
  • Alt-Drag: Select the text dragged within the rectangle
macOS Defaults
  • Ctrl-b: Move the cursor one character to the left (which is backward in left-to-right text, forward in right-to-left text). (with Shift: Move the selection head one character to the left, while leaving the anchor in place.)
  • Ctrl-f: Move the cursor one character to the right. (with Shift: Move the selection head one character to the right, while leaving the anchor in place.)
  • Ctrl-p: Move the cursor one line up. (with Shift: Move the selection head one line up.)
  • Ctrl-n: Move the cursor one line down. (with Shift: Move the selection head one line down.)
  • Ctrl-a: Move the cursor to the start of the line. (with Shift: Move the selection head to the start of the line.)
  • Ctrl-e: Move the cursor to the end of the line. (with Shift: Move the selection head to the end of the line.)
  • Ctrl-d: Delete the selection or the character after the cursor.
  • Ctrl-h: Delete the selection, or, for cursor selections, the character before the cursor.
  • Ctrl-k: Delete the selection, or, if it is a cursor selection, delete to the end of the line. If the cursor is directly at the end of the line, delete the line break after it.
  • Ctrl-Alt-h: Delete the selection or backward until the end of the next group, only skipping groups of whitespace when they consist of a single space.
  • Ctrl-o: Replace each selection range with a line break, leaving the cursor on the line before the break.
  • Ctrl-t: Flip the characters before and after the cursor(s).
  • Ctrl-v: Move the selection one page down.