Help › Write SQL

Edit in several places at once

Put several cursors in the SQL editor, select every occurrence of a word, and make column selections.

Querlyn 0.1.0 is not released yet. This help describes it ahead of release.

The editor can have several cursors. What you type, delete or paste then happens at each of them. The status bar says how many there are, such as "3 cursors".

Add cursors

ToDo this
Add a cursor where you click⌥ on macOS or Alt on Windows and Linux-click. ⌥ on macOS or Alt on Windows and Linux-click on a cursor removes it.
Add a cursor on the line above or below⌥⌘↑ on macOS or Alt+Shift+Up on Windows and Linux, ⌥⌘↓ on macOS or Alt+Shift+Down on Windows and Linux
Put a cursor at the end of every selected line⌥⇧I on macOS or Alt+Shift+I on Windows and Linux
Go back to one cursor⎋ on macOS or Esc on Windows and Linux

The commands are also in the Selection menu.

Select every occurrence of a word

  • ⌘D on macOS or Ctrl+D on Windows and Linux (Selection › Add Next Occurrence) selects the word at the cursor. Press it again to also select the next occurrence, and again for the one after. It wraps around at the end of the text.
  • ⇧⌘L on macOS or Ctrl+Shift+L on Windows and Linux (Selection › Select All Occurrences) selects all of them at once.

Then type: every occurrence changes together.

Starting from a cursor, only whole words in the same upper and lower case are matched, so id does not select part of order_id. Starting from a selection you made yourself, that exact text is matched wherever it is.

Select a column of text

Hold ⌥ on macOS or Alt on Windows and Linux and drag to select a rectangle across lines: a column selection. ⇧ on macOS or Shift on Windows and Linux and ⌥ on macOS or Alt on Windows and Linux with a click or a drag selects the rectangle from the cursor to where you click.

Lines that end before the rectangle's left edge get no selection.

What happens at each cursor

  • Typing and deleting happen at every cursor, as one step to undo.
  • Pasting as many lines as there are cursors puts one line at each cursor. Otherwise the whole text is pasted at each.
  • Taking a suggestion inserts it at every cursor.
  • A snippet is inserted at every cursor, and its fields are filled in at all of them together.
  • Expand * to Columns and Qualify Columns run at every cursor; the other refactorings use the first cursor and say so.
  • Cursors that meet become one.

Selecting all occurrences stops at 10,000 cursors and says so.

Help for Querlyn 0.1.0. All help topics