Docs Editor
Tabs, files and comparing
Query tabs that come back on relaunch, .sql/.xml/.json files, a Files pane for your project folder, split views, comparing tabs and files, and local history.
On this page
#Query tabs
Each tab has its own connection, database and run. Tabs save as you type and all come back when you relaunch, with their text, connection and database.
- ⌘T opens a new tab on the current connection; ⇧⌘T reopens the tab you just closed.
- Rename Tab… (Query menu, or right-click the tab) names a tab.
- The connection and database pickers in the toolbar change the tab's connection; the colour bar shows its environment.
- ⌘\ splits the editor to show two tabs side by side.
#Files
- File ▸ Open… (⌘O) opens
.sql,.xml,.jsonand other text files in tabs; Save (⌘S) and Save As… (⇧⌘S) write them. - A tab with unsaved changes shows a dot, and closing it or quitting asks first.
- UTF-16 files, common from SSMS, are read and saved back as UTF-16.
- If a file changes on disk, a tab with no unsaved changes reloads it; one with unsaved changes asks.
#The Files pane
Open Folder… shows a folder, such as your project's sql/ directory, in the Files pane of the sidebar. Double-click a file to open it, drag one into the editor to insert its text, and right-click for Reveal in Finder, Open in Terminal, Copy Path and Analyze Folder.
#XML and JSON
.xml and .json tabs have their own highlighting. Format (⇧⌘F) pretty-prints them, keeping key order and every value exactly as written; Validate jumps to the first error. Entities and DTDs are never resolved.
#Compare tabs and files
Like VS Code's Select for Compare:
- Right-click a tab (or a file in the Files pane) and choose Select for Compare.
- Right-click another and choose Compare with Selected.
The differences open side by side in a compare tab. Also:
- Compare with Current Tab in a tab's right-click menu;
- Query ▸ Compare with Tab ▸ any open tab;
- Query ▸ Compare with Clipboard, handy for a script someone sent you;
- in the Files pane, select two files and choose Compare Selected.
#Local history
Lukla keeps earlier versions of every tab as you work. File ▸ Local History… shows them on the left and the chosen version against the current text on the right, so you can get back a query you overwrote.
#Word wrap and line numbers
View ▸ Word Wrap (⌥Z) wraps long lines; View ▸ Show Line Numbers turns the gutter's numbers on and off.