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.