Help › Write SQL
Edit text in the SQL editor
The editor's everyday keys for moving, selecting, indenting, commenting, undoing and deleting, in one place.
Querlyn 0.1.0 is not released yet. This help describes it ahead of release.
The SQL editor behaves like the editor of a modern code editor. This topic lists what it does with plain typing and the keys for moving and changing text. Every key here can be changed; see Change keyboard shortcuts.
What happens as you type
- Indentation is kept. ↩ on macOS or Enter on Windows and Linux starts the new line at the indentation of the line you were on.
- Brackets and quotes come in pairs. Typing
(or'inserts the closing one too, and typing the closing one when it is already there moves over it. - The matching bracket is highlighted when the cursor is beside a bracket.
- The line the cursor is on is tinted.
- SQL is colored by what each word is: keywords, names, strings, numbers and comments, in the dialect of the tab's connection. A tab with no connection is read as PostgreSQL.
The status bar shows the cursor's line and column, how much is selected, the dialect, and whether the text uses LF or CRLF line endings.
Indent and comment
| To | Press |
|---|---|
| Indent the line, or the selected lines | ⇥ on macOS or Tab on Windows and Linux |
| Remove one level of indentation | ⇧⇥ on macOS or Shift+Tab on Windows and Linux |
Turn the line, or the selected lines, into -- comments and back | ⌘/ on macOS or Ctrl+/ on Windows and Linux |
Indentation is four spaces.
Copy, cut and undo
| To | Press |
|---|---|
| Copy | ⌘C on macOS or Ctrl+C on Windows and Linux |
| Cut | ⌘X on macOS or Ctrl+X on Windows and Linux |
| Paste | ⌘V on macOS or Ctrl+V on Windows and Linux |
| Undo | ⌘Z on macOS or Ctrl+Z on Windows and Linux |
| Redo | ⇧⌘Z on macOS or Ctrl+Y on Windows and Linux |
With nothing selected, Copy and Cut take the whole line.
Undo goes back one step at a time: a word you typed, a deletion, a paste, a format, a refactoring.
Select
| To select | Press |
|---|---|
| Everything | ⌘A on macOS or Ctrl+A on Windows and Linux |
| The line | ⌘L on macOS or Ctrl+L on Windows and Linux |
| One character left or right | ⇧← on macOS or Shift+Left on Windows and Linux, ⇧→ on macOS or Shift+Right on Windows and Linux |
| One line up or down | ⇧↑ on macOS or Shift+Up on Windows and Linux, ⇧↓ on macOS or Shift+Down on Windows and Linux |
| One word left or right | ⌥⇧← on macOS or Ctrl+Shift+Left on Windows and Linux, ⌥⇧→ on macOS or Ctrl+Shift+Right on Windows and Linux |
| To the start or end of the line | ⇧⌘← on macOS or Shift+Home on Windows and Linux, ⇧⌘→ on macOS or Shift+End on Windows and Linux |
| To the start or end of the text | ⇧⌘↑ on macOS or Ctrl+Shift+Home on Windows and Linux, ⇧⌘↓ on macOS or Ctrl+Shift+End on Windows and Linux |
| A page up or down | ⇧⇞ on macOS or Shift+PageUp on Windows and Linux, ⇧⇟ on macOS or Shift+PageDown on Windows and Linux |
With the mouse, drag to select, double-click to select a word and triple-click to select a line. ⇧ on macOS or Shift on Windows and Linux-click extends the selection to where you click. Edit in several places at once covers several cursors and column selections.
Move
| To move | Press |
|---|---|
| One character or line | ← on macOS or Left on Windows and Linux, → on macOS or Right on Windows and Linux, ↑ on macOS or Up on Windows and Linux, ↓ on macOS or Down on Windows and Linux |
| One word left or right | ⌥← on macOS or Ctrl+Left on Windows and Linux, ⌥→ on macOS or Ctrl+Right on Windows and Linux |
| To the start or end of the line | ⌘← on macOS or Home on Windows and Linux, ⌘→ on macOS or End on Windows and Linux |
| To the start or end of the text | ⌘↑ on macOS or Ctrl+Home on Windows and Linux, ⌘↓ on macOS or Ctrl+End on Windows and Linux |
| A page up or down | ⇞ on macOS or PageUp on Windows and Linux, ⇟ on macOS or PageDown on Windows and Linux |
Delete
| To delete | Press |
|---|---|
| The character before or after the cursor | ⌫ on macOS or Backspace on Windows and Linux, ⌦ on macOS or Delete on Windows and Linux |
| The word before or after the cursor | ⌥⌫ on macOS or Ctrl+Backspace on Windows and Linux, ⌥⌦ on macOS or Ctrl+Delete on Windows and Linux |
| From the cursor back to the start of the line | The shortcut lists for Delete to Line Start |
Leave the editor with the keyboard
In the editor, ⇥ on macOS or Tab on Windows and Linux indents. If you move between parts of the window with ⇥ on macOS or Tab on Windows and Linux, press ⌃⇧M on macOS or Ctrl+M on Windows and Linux (): then ⇥ on macOS or Tab on Windows and Linux leaves the editor and moves on to the next control, until you press it again.
⎋ on macOS or Esc on Windows and Linux closes whatever is open over the editor, one thing at a time: the list of suggestions, a snippet's fields, the find bar, then extra cursors, then the selection.
⌘1 on macOS or Ctrl+1 on Windows and Linux brings the keyboard back to the editor from anywhere in the window.
What the editor does not do
- It does not wrap long lines; scroll sideways to read them.
- It has no minimap.
Help for Querlyn 0.1.0. All help topics