Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Welcome to Ettin Edit

Edda and Ottar, the two-headed Ettin Edit mascot

Ettin Edit is a fast, friendly text editor for Linux and Windows. It is inspired by Notepad++, shares none of its code, and builds in the tools people usually add to Notepad++ with plugins: JSON and XML tools, a compare view, SQL over CSV files, and more.

This manual explains how to use every part of the editor and how to make it your own. You can read it in two places:

Both show the same text, written for the version of Ettin Edit you have.

Meet the heads

In Norse myth an ettin is a giant, and the famous ones had more than one head. Ours has two. Edda keeps your tabs in order and has never once lost an unsaved file. Ottar compares everything with everything else and keeps asking for one more plugin. You'll see their opinions in the odd tip box.

Where to start

If you want to…Read
Install it, or get the newest versionInstalling and updating
Try the main ideas in two minutesHelp > Welcome, then Try it on sample text (The Welcome tab)
Know what everything on screen isA tour of the window
Open, save and juggle filesFiles and tabs
Edit faster: multiple carets, line tools, completionEditing text
Find and replace, in one file or a whole folderFinding and replacing
Format JSON, check XML, decode Base64Tools
Compare two filesCompare
Query a CSV file with SQLCsvQuery
Change fonts, shortcuts and coloursMaking it yours
Add or write pluginsUsing plugins

Finding your way around this manual

  • The contents are on the left. In the app, the box at the top searches every page; on the web, press S or click the magnifying glass.
  • Menu commands are written like File > Open…: open the File menu, then choose Open….
  • Keyboard shortcuts look like Ctrl+Shift+F. These are the defaults; if you change them in the Shortcut Mapper, the menus show your own.
  • Every command is also in the command palette: press F1 and type a few letters of its name.

Edda says: you don't have to read this front to back. Skim the tour, then come back when you wonder whether Ettin Edit can do something. It probably can.

Installing and updating

Ettin Edit runs on 64-bit Windows and 64-bit Linux (X11 or Wayland). Every release is on the releases page.

Windows

Download one of these:

  • ettin-edit-<version>-setup.exe, the installer. Run it and pick:

    • Install for me only, which needs no administrator rights, or Install for all users.
    • A desktop shortcut (optional).
    • Edit with Ettin Edit in the right-click menu of every file in Explorer.
    • Open with entries for 33 common text and code file types.
    • Adding Ettin Edit to the PATH, so ettin-edit file.txt works in a terminal (optional).

    Ettin Edit then appears in the Start menu. Remove it from Settings > Apps like any other program.

  • The .zip, if you'd rather not install anything. Extract it anywhere and run ettin-edit.exe. Your settings still go to %APPDATA%\EttinEdit (see Files, folders and the command line).

Linux

Your systemDownloadInstall with
Arch, CachyOS, Manjaro, EndeavourOS.pkg.tar.zstsudo pacman -U ./ettin-edit-*.pkg.tar.zst
Debian, Ubuntu, Mint, Pop!_OS, Zorin OS.debsudo apt install ./ettin-edit_*_amd64.deb
Fedora, openSUSE.rpmsudo dnf install ./ettin-edit-*.x86_64.rpm (openSUSE: sudo zypper install ./ettin-edit-*.x86_64.rpm)
Any Linux, with Flatpak.flatpakOpen it in your software centre, or flatpak install --user ./ettin-edit-*-x86_64.flatpak
Any Linux, nothing to install.AppImageMake it executable and run it
Anything else.tar.gzExtract it and run ./ettin-edit

The packages and the Flatpak add Ettin Edit to your application menu with its icon, and offer it in Open With for text files. They carry Ettin Edit's AppStream file, so software centres such as GNOME Software, KDE Discover and Ubuntu's App Center show its licence (MIT), website, release notes and age rating.

Getting updates on Debian and Ubuntu

From 1.4.0 the .deb also adds the Ettin Edit package repository, which lives next to this manual on GitHub Pages. After that, your software updater (or sudo apt update && sudo apt upgrade) installs new versions like any other app. From 1.9.1 the repository also carries the app details software centres read, so once it's added, Ettin Edit shows up in their search with its licence, screenshots and release notes. Install the latest .deb by hand once if you have one older than 1.4.0.

The repository's settings are in /etc/apt/sources.list.d/ettin-edit.sources. Delete that file to stop getting updates this way.

To add the repository without downloading the .deb first, which also gets you the full software centre page before installing:

sudo curl -fsSLo /usr/share/keyrings/ettin-edit-archive-keyring.gpg \
  https://tharkis.github.io/Ettin-Edit/apt/ettin-edit-archive-keyring.gpg
sudo curl -fsSLo /etc/apt/sources.list.d/ettin-edit.sources \
  https://tharkis.github.io/Ettin-Edit/apt/ettin-edit.sources
sudo apt update && sudo apt install ettin-edit

Why a downloaded .deb shows "Unknown licence"

If you open the .deb file itself in GNOME Software (the Software app on Zorin OS, and on many Ubuntu-based systems), the page says "Unknown licence" and "No software repository included". That page only reads the package's basic fields, which have no licence field, and it only recognises Fedora-style repositories, so no .deb can change it. The package does have the licence, release notes and repository, and they show once it's installed or once the repository is added (see above). For the full page before installing, use the Flatpak, or add the repository first.

Fedora and openSUSE

The .rpm installs Ettin Edit and adds the Ettin Edit RPM repository (for dnf, and zypper on openSUSE) at https://tharkis.github.io/Ettin-Edit/rpm. From then on your software updater, sudo dnf upgrade or sudo zypper update installs new versions. The package and repository are signed; the first time it updates, dnf (or zypper) asks you to trust the Ettin Edit key. The repository's settings are in /etc/yum.repos.d/ettin-edit.repo (/etc/zypp/repos.d/ettin-edit.repo on openSUSE); delete that file to stop getting updates this way.

To add the repository without downloading the .rpm first:

sudo rpm --import https://tharkis.github.io/Ettin-Edit/rpm/RPM-GPG-KEY-ettin-edit
sudo curl -fsSLo /etc/yum.repos.d/ettin-edit.repo \
  https://tharkis.github.io/Ettin-Edit/rpm/ettin-edit.repo
sudo dnf install ettin-edit

Flatpak

The .flatpak runs Ettin Edit on the freedesktop.org runtime, which your system downloads from Flathub the first time (add Flathub with flatpak remote-add --if-not-exists flathub https://dl.flathub.org/repo/flathub.flatpakrepo if you haven't). Opening the file in a software centre shows the full app page, licence included. Installing it also adds the Ettin Edit Flatpak repository, so flatpak update and your software centre install new versions. You can also install straight from the repository:

flatpak install --user https://tharkis.github.io/Ettin-Edit/flatpak/ettin-edit.flatpakref

The Flatpak can open any file on your computer. Git (for Compare to Last Commit (Git)), Open Terminal Here and plugins run on your computer itself, not in the sandbox, so they use the Python, Node.js, Git and terminal you have installed. A Flatpak keeps its settings in ~/.var/app/io.github.tharkis.EttinEdit/config/EttinEdit, apart from other installs (copy your ~/.config/EttinEdit there to bring them along).

AppImage

The .AppImage is one file that runs on almost any 64-bit Linux: make it executable (chmod +x ettin-edit-*.AppImage, or tick "Allow executing" in its properties) and run it. Tools such as Gear Lever or AppImageLauncher add it to your application menu and can update it, and so can Ettin Edit itself (see Updating). Like the .tar.gz, it uses your system's OpenGL and libxkbcommon-x11.

The .tar.gz needs the usual desktop libraries, which almost every desktop already has: OpenGL and, on X11, libxkbcommon-x11. On Debian or Ubuntu: sudo apt install libxkbcommon-x11-0 libgl1.

Building the Arch package yourself

From a copy of the source code:

cd packaging/arch
makepkg -si

Building from source

Install Rust from https://rustup.rs, then in the source folder:

cargo build --release      # the program is target/release/ettin-edit
cargo run --release -- notes.txt

Updating

On Debian, Ubuntu, Fedora and openSUSE, the package repository brings updates through your software updater (see above), and the Flatpak updates through flatpak update or your software centre. Everywhere else, and with the packages too if you like, Ettin Edit updates itself:

Help > Check for Updates… (also on the toolbar's Home tab) asks GitHub whether there's a newer release. If there is, it shows what changed and an Update Now button. Ettin Edit downloads the file that matches how you installed it, checks it against the SHA-256 checksum GitHub lists for it, and installs it:

Installed withWhat Update Now does
Arch / CachyOS packageInstalls the new .pkg.tar.zst with pacman -U. Your desktop asks for your password first.
Debian / Ubuntu packageInstalls the new .deb with apt-get install. Your desktop asks for your password first.
Fedora / openSUSE packageInstalls the new .rpm with dnf install (zypper on openSUSE). Your desktop asks for your password first.
AppImagePuts the new .AppImage in place of the one you started.
FlatpakNothing: it says updates come through your software centre or flatpak update.
.tar.gz or Windows .zipReplaces the ettin-edit program in the folder you unpacked it to.
Windows installerDownloads the new setup.exe. Install and Restart closes Ettin Edit, installs the update without any questions and starts Ettin Edit again. Installed for everyone, Windows asks for permission first.

When it's done, Restart Now closes Ettin Edit and starts the new version. It closes the way File > Exit does, so you're asked about unsaved changes (or they're kept, if Preferences remembers them), and your open files come back. Later keeps working with the old version until you next start Ettin Edit (with the Windows installer, it installs the update when you close Ettin Edit). Your settings, themes and plugins are kept.

The password prompt comes from pkexec. Without it, Ettin Edit shows the command to run in a terminal instead, with a Copy button. A copy built from source, or one in a folder you can't write to, can't update itself; the dialog says so and offers the download page. If the download doesn't match its checksum it isn't installed.

Downloads wait in ~/.cache/ettin-edit/updates on Linux (%LOCALAPPDATA%\ettin-edit\updates on Windows) and are removed by the next update.

Ettin Edit also checks by itself once a week and only speaks up when there's something new. Turn that off with Help > Check for Updates Automatically, or in Preferences under Files and Startup. The check sends nothing about you or your files; it only reads the public list of releases.

Coming from NixPad

Ettin Edit used to be called NixPad. The first time Ettin Edit starts, it copies your NixPad settings, session, backups, themes and plugins to its own folder, and plugins written for NixPad keep working. The old folder is left alone, so you can delete it when you're happy.

A tour of the window

Ettin Edit draws its whole window itself, so it looks the same on Linux and Windows and follows the colours of the theme you pick.

Ettin Edit with a JSON file open and the JSON tree panel beside it

The Welcome tab

The first time Ettin Edit starts, it opens a Welcome tab: what the editor is for, the four things to try first (Transform, the command palette, recipes and Filter Through Command), and what's new in this version. Click a card to open it.

The Welcome tab: Welcome to Ettin Edit, cards for Transform, Command palette (F1), Recipes (Ctrl+Alt+R) and Filter Through Command (Ctrl+Alt+P), buttons Try it on sample text, Open the manual and Open a file, and What's new in 2.2.0 on the right

  • Try it on sample text opens a new tab with a few log lines and a line of JSON, and a two-step guided tour above it: keep only the ERROR lines with Keep Matching Lines, then turn the JSON into YAML with Convert to. Show me does each step for you; End tour puts the tour away.
  • After an update, the tab opens once more, headed What's new, with the new version's release notes.
  • Show this tab when Ettin Edit starts opens it every time. Help > Welcome (or ? on the toolbar) opens it whenever you like.

The Welcome tab can't be edited or saved, and isn't kept between sessions.

From top to bottom:

The menu bar

You can hide the menu bar to give the window a cleaner look: choose View > Menu Bar or press Ctrl+M. While it's hidden, tap Alt on its own to show it for a moment; it goes away again when you run a command, press Escape or Alt, or click elsewhere. Press Ctrl+M (or use View > Menu Bar from the shown menu, or right-click the toolbar) to keep it showing again. The toolbar can be hidden too, and Ettin Edit remembers both choices.

MenuWhat's in it
FileNew, open, save, recent files, print, rename, workspace folders, close
EditUndo, clipboard, line operations, comments, multi-select, completion, column editor, read-only
SearchFind, replace, Find in Files, marks, Go to Line, bookmarks
ViewWord wrap, symbols, panels, split view, folding, zoom, distraction-free mode, the menu bar, the toolbar and the Theme
EncodingThe encoding the file is saved in, or read it again in another one
LanguagePick the highlighting language, add your own languages
TransformEverything that changes the text: filter through a shell command, recipes, macros, find and replace, lines, case, Convert to, encoding and hashes, JSON and XML formatting
ToolsTools that look at the text without changing it: Compare, CsvQuery, JSON Tree, the XPath panel, XML checks and XSL Transform
PluginsYour plugins' commands, and managing plugins
SettingsPreferences, the Shortcut Mapper, Customise Toolbar and quick on/off switches
HelpThe Welcome tab, this manual, update checks and About

Until 2.1 there were also Theme and Macro menus; they are View > Theme and Transform > Macros now.

Under the menu bar is the toolbar: tabs of buttons for the commands you use most. Right-click it to customise it, or press Ctrl+F1 to collapse it to its tab names. Its Home tab puts transforms first, ? at its right opens the Help menu, and ☰ Simplified makes it one row of small buttons.

Help > About Ettin Edit shows the version you have.

Right-clicking the text gives you Cut, Copy and Paste, the commands that fit what you clicked (a selection, or a JSON, XML or CSV file), then the whole Transform menu, Recipes and More Edit Commands, so you rarely need to go up to the menu bar. See the right-click menu.

Tabs

Each open file has a tab. A dot on a tab means it has unsaved changes, and a pin means it's pinned. At the end of the tab bar:

  • + opens a new, empty tab (Ctrl+N).
  • ⏷ opens the tab list, handy when there are more tabs than fit.

Right-click a tab for close, pin, split-view and file commands. Hover over it to see the file's full path.

When the window is split in two, each half has its own tab bar.

The find bar

Ctrl+F or Ctrl+H opens the find bar above the text. See Finding and replacing.

The editor

The text itself, with the gutter on its left:

  • line numbers,
  • bookmarks (click the gutter next to a line, or press Ctrl+F2),
  • fold markers: − folds a block away and + shows it again.

The editor highlights the current line, the bracket matching the one at the caret, and other places where the selected word appears. Everything it shows can be turned on and off in the View menu.

Panels

Panels open beside the text and stay until you close them:

PanelWhereOpens with
Folder as WorkspaceleftFile > Open Folder as Workspace…
Function ListrightView > Function List
Document MaprightView > Document Map
JSON treerightCtrl+Alt+J
Search resultsbottomFind All or Find in Files
XPathbottomCtrl+Alt+Shift+E
CsvQuerybottomCtrl+Alt+Q
Plugin panelsright or bottomthe plugin's own command

Drag the edge of a panel to resize it.

The status bar

On the left:

  • The language, such as Rust or Plain Text. Click it to choose another.
  • length (characters) and lines in the document.
  • In XML files, the XPath of the element at the caret. Click it to copy it.
  • ● Recording macro while a macro is being recorded.
  • Read-only when the tab is read-only. Click it to allow editing again.

On the right:

  • Ln and Col, the caret's line and column, followed by Sel (how many characters are selected) and how many carets there are, when that applies. Click it to go to a line.
  • The line ending: Windows (CR LF), Unix (LF) or Macintosh (CR). Click it to change the document's line endings.
  • The encoding, such as UTF-8. Click it for the Encoding menu.
  • The zoom level.

The command palette

Press F1 anywhere. Type a few letters of any command, for example dup for Edit › Line Operations › Duplicate, then press Enter. Words can be in any order and needn't be complete, and each command shows its shortcut, so the palette is also a good way to learn them. Commands you used recently come first, and so does json → Format JSON: names that start with what you typed rank above names that only contain it. Your recipes and your plugins' commands are in the list too.

Files and tabs

Opening files

  • File > Open… (Ctrl+O) opens one or more files; select several in the dialog to open them all.
  • File > Open Recent lists the last 12 files you had open. Clear Recent Files at the bottom empties the list.
  • Drag files from your file manager onto the window.
  • Excel and OpenDocument workbooks open as a table; File > Open as Table… opens a CSV or JSON file as a table too.
  • Pass them on the command line: ettin-edit notes.txt todo.md (see the command line).
  • On Windows, right-click a file and choose Edit with Ettin Edit, if you turned that on when installing.
  • In the folder workspace, click a file.

A file opened while the only tab is an untouched new one replaces that tab, so you don't collect empty tabs.

Ettin Edit works out each file's encoding and line endings and its language as it opens it, and keeps them when you save. Very large files are fine: a 50 MB log opens in about a second, and word wrap keeps up when you resize the window.

One window or several

By default there is one Ettin Edit window. Opening a file from your file manager or a terminal while Ettin Edit is running sends it to the open window instead of starting a second copy, and brings that window to the front, even when it was minimized. To get separate windows, turn off Settings > Single Window, or start Ettin Edit with --multi-instance.

New files

File > New (Ctrl+N) or the + at the end of the tabs opens an empty tab named new 1, new 2 and so on. Its line ending, encoding and language come from Preferences > New Documents.

Saving

CommandShortcutWhat it does
File > SaveCtrl+SSaves the current tab. A new tab asks for a name.
File > Save As…Ctrl+Alt+SSaves under a new name; the tab then shows that file.
File > Save AllCtrl+Shift+SSaves every tab with changes.

The file keeps its encoding, line endings and byte-order mark. If the text holds a character the file's encoding can't store, Ettin Edit refuses to save and tells you which character it is, rather than quietly losing it. Pick another encoding from the Encoding menu and save again.

XML files can be checked for mistakes every time they're saved; see XML Tools.

Tabs

  • Click a tab to switch to it, or use Ctrl+Tab / Ctrl+Shift+Tab (also Ctrl+PageDown / Ctrl+PageUp) for the next and previous tab.
  • Drag a tab to move it along the tab bar.
  • Close a tab with its ×, a middle-click, or Ctrl+W. File > Close All (Ctrl+Shift+W) and File > Close Others close the rest.
  • Pin Tab (right-click a tab) keeps a tab at the front with a pin on it. Close All and Close Others leave pinned tabs open, and the × on a pinned tab unpins it instead of closing it.
  • Closing a tab with unsaved changes asks whether to save them.

The tab's right-click menu

CommandWhat it does
Close, Close OthersClose this tab, or every other one
Pin Tab / Unpin TabSee above
Move to Other View, Clone to Other ViewSee split view
Reload from DiskRead the file again, replacing what's in the tab (Undo brings your version back)
Rename…Rename the file on disk; the tab follows it
Move to Trash…Move the file to the Recycle Bin or trash and close the tab
Open Containing FolderShow the file in your file manager, selected where possible
Open Terminal HereOpen a terminal in the file's folder
Copy Full Path, Copy File NameCopy them to the clipboard

The file commands are also in the File menu, for the current tab. Open Terminal Here uses Windows Terminal or cmd on Windows; on Linux it tries $TERMINAL, then common terminals such as Konsole and GNOME Terminal.

You won't lose your work

Ettin Edit backs up unsaved changes every few seconds, including tabs that were never saved. If Ettin Edit, your computer or the power goes away, your tabs and their changes are back next time you start it.

When you quit, Ettin Edit remembers the open tabs, unsaved changes included, without asking, and reopens everything next time: each tab's caret, encoding, line ending, language, pin, read-only state and the split view. If you'd rather be asked to save each file when quitting, turn off Settings > Remember Unsaved Changes on Exit. To start with no tabs from last time, turn off Reopen the files that were open last time in Preferences.

When another program changes the file

If a file you have open is changed by another program, a bar appears above the text:

  • Reload reads the new version. If you had unsaved changes, Undo brings them back.
  • Keep My Version leaves your text alone; saving will overwrite the other program's changes.

If the file is deleted or moved, the bar offers Keep Open, which keeps the text in the tab so you can save it again, or Close.

To reload changed files without being asked, turn on Settings > Reload Files Changed on Disk Automatically. It only reloads files that have no unsaved changes in Ettin Edit.

Read-only tabs

Edit > Read-Only stops a tab from being changed by accident. The status bar shows Read-only; click it, or choose the command again, to allow editing.

Your settings on another computer

Settings > Export Settings… and Import Settings… move your settings, shortcuts, toolbar, themes, recipes and languages in one file. See Moving your settings to another computer.

Summary

View > Summary… shows the file's full path, when it was created and changed, its encoding, and how many characters, words and lines it has, plus its size on disk and the same counts for the selection.

Editing text

The basics

Ettin Edit edits text the way you'd expect, plus a few extras:

KeysWhat they do
Ctrl+Z / Ctrl+YUndo and redo. Typing is undone a burst at a time, and the tab knows when you're back at the saved version.
Ctrl+X / Ctrl+C / Ctrl+VCut, copy and paste
Ctrl+ASelect everything
HomeGo to the first non-blank character of the line; press again for the very start
Ctrl+Left / Ctrl+RightMove a word at a time
Ctrl+Backspace / Ctrl+DeleteDelete a word at a time
Tab / Shift+Tab on selected linesIndent or outdent them
Double-click / triple-clickSelect a word / a line. Keep the button down and drag to select by words or lines.

Enter keeps the current line's indentation. Whether Tab inserts a tab or spaces, and how wide a tab is, are set in Preferences or Settings > Indent With Spaces.

Multiple carets

Several carets let you make the same change in several places at once. Everything you type, delete or paste happens at each of them.

ToDo this
Add a caretCtrl+click or Alt+click
Add a selectionCtrl+drag
Add a caret on the line above or belowCtrl+Alt+Up / Ctrl+Alt+Down
Select the next place the selected text appearsCtrl+Shift+D (Edit > Multi-Select > Select Next Occurrence)
Select every place it appearsAlt+F3 (Select All Occurrences)
Put a caret on every search matchSearch > Select All Matches
Go back to one caretEsc

Pasting several lines onto the same number of carets puts one line at each caret, which is handy for filling in a column.

The status bar shows how many carets there are.

Column (box) selection

Hold Alt and drag, or use Alt+Shift with the arrow keys, to select a rectangle. Typing then replaces or inserts on every row, and Backspace and Delete work on every row too.

Column Mode

Edit > Column Mode (Alt+Shift+C) saves holding Alt: while it's on, a plain drag and Shift with the arrow keys select a rectangle, and the status bar says Column mode. A plain click still puts one caret where you click, and Shift+click still extends a normal selection. Click Column mode in the status bar, or use the command again, to turn it off. It's off each time Ettin Edit starts.

Column Editor

Edit > Column Editor… (Alt+C) inserts the same thing at every caret, or at the caret's column on each line below it:

  • Text to insert: the same text on every line.
  • Numbers to insert: a sequence, with an Initial number, how much to Increase by, how many times to Repeat each number, Leading zeros, and Dec, Hex, Oct or Bin.

For example, start 1, increase by 1, on ten lines gives 1 to 10; with leading zeros it gives 01 to 10.

Line operations

Edit > Line Operations. The commands in this table work on the lines the selection touches, or on the caret's line:

CommandShortcut
DuplicateCtrl+D
Delete LinesCtrl+Shift+L
Move Up / Move DownCtrl+Shift+Up / Ctrl+Shift+Down
Join LinesCtrl+J
Split Lines at Long-Line ColumnCtrl+I
Insert Blank Line Above / BelowCtrl+Alt+Enter / Ctrl+Alt+Shift+Enter

Below them, the same submenu repeats Transform > Lines (sorting, removing duplicate and empty lines, trimming, tabs and spaces, and the rest), so it is where Notepad++ users look for it. Sorting, removing lines, trimming and changing case are described in Transforming text.

Comments

Edit > Comment > Toggle Line Comment (Ctrl+Q) comments out the selected lines, or uncomments them if they're all comments. Toggle Block Comment (Ctrl+Shift+Q) wraps the selection in a block comment. Ettin Edit uses the right markers for the tab's language: // and /* */ in Rust, # in Python, <!-- --> in HTML, and so on.

Date and time

Edit > Insert > Date and Time puts the current date and time at the caret, short (F5) or long (Shift+F5).

Typing helpers

Each of these can be turned off in the Settings menu or in Preferences.

  • Auto-Close Brackets and Quotes: typing (, [, {, " or ' adds the closing one. Typing the closer steps over it, Backspace removes an empty pair, and typing an opener with text selected wraps the selection.
  • Close Tags Automatically (XML and HTML, in Tools): typing > after <p adds </p>. Empty HTML elements such as <br> are left alone.
  • Smart Indentation: Enter after {, ( or [ (and after : in Python and YAML) indents the new line, and between {} it puts the closing bracket on a line of its own. Typing a closing bracket outdents.
  • Word Completion: as you type, a list offers words already in the document. Ctrl+Space opens it at any time.
  • Keyword and Function Completion: the list also offers the language's keywords and functions, each with its signature.
  • Parameter Hints: typing ( after a function's name shows its parameters above the caret, with the one you're on in bold. It follows you from argument to argument; Esc hides it and Ctrl+Shift+Space brings it back.

In the completion list, use the arrow keys and Enter or Tab to pick a word, or Esc to close it.

Completion knows Python, JavaScript and TypeScript, Rust, C, C++, C#, Java, Go, PHP, Lua, Ruby, Kotlin, Swift, SQL, PowerShell, CSS, HTML and shell scripts, plus the functions your document defines. You can add your own lists; see Languages.

Matching brackets and tags

Putting the caret next to a bracket highlights its partner; an unmatched bracket turns red. In HTML and XML the matching opening or closing tag is highlighted too. Other places where the selected word appears are lightly highlighted, which makes typos easy to spot.

Finding and replacing

The find bar

Search > Find… (Ctrl+F) opens the find bar above the text. If you had text selected, it's already filled in. Ettin Edit searches as you type, highlights every match, and shows 3 of 17 so you know where you are.

In the find barWhat it does
Enter / Shift+EnterNext / previous match
↓ / ↑Next / previous match (also F3 / Shift+F3 from anywhere)
AaMatch case
WWhole words only
\nExtended: \n, \t, \xNN and the like mean those characters
.*Regular expression
…More: Wrap around, Find All, Select All Matches, Mark All
Esc or ×Close the find bar

With Wrap around on (the default), searching past the last match starts again at the top.

Find Selected Next (Ctrl+F3) and Find Selected Previous (Ctrl+Shift+F3) search for the selected text, or the word at the caret, without opening the find bar.

Replacing

Search > Replace… (Ctrl+H), or the ⏵ arrow at the left of the find bar, adds a second row:

  • Replace replaces the current match and moves to the next. Pressing Enter in the replace box does the same.
  • Replace All replaces every match as one undo step. It stays fast on big files: 282,000 replacements in a 50 MB file take about a second.
  • In selection limits Replace All to the selected text. It's turned on for you when you open the bar with several lines selected.

Leave the replace box empty to delete what you searched for: Replace All with an empty box removes every match. This works in all three modes, so Extended \r\n or the regular expression \r\n with an empty replacement joins every line into one.

Line breaks

Ettin Edit keeps every line break as one character while you edit, and writes the tab's own line ending (shown in the status bar) when it saves. So in Extended mode and in regular expressions, \r\n, \r and \n all find a line break, whether the file uses Windows (CR LF), Unix (LF) or old Mac (CR) line endings. A match on a line break is highlighted just past the end of its line.

In a regular expression, an optional \r (as in \r?\n) finds nothing on its own, so \r?\n still finds exactly one line break. To change the line endings a file is saved with, click the line ending in the status bar (see Line endings).

Extended mode (\n, \t, \xNN)

Turn on \n to search for characters you can't type in the find box, without writing a regular expression. Everything else in the box is plain text, so . and * still mean themselves. Extended mode and regular expressions are two ways of reading the box, so turning one on turns the other off. The same escapes work in the replacement.

WriteTo mean
\nA line break
\rA line break too: Ettin Edit keeps every line break as one character and writes the tab's own line ending when it saves, so \r\n, \r and \n all mean a line break
\tA tab
\0The NUL character
\\A backslash
\xNNThe character with hex code NN, such as \x41 for A
\uNNNN or \u{N…}Any Unicode character, such as \u00E9 for é or \u{1F600} for 😀
\dNNNThe character with decimal code NNN (up to 255), such as \d065
\oNNNThe character with octal code NNN (up to 377), such as \o101
\bNNNNNNNNThe character with binary code NNNNNNNN, such as \b01000001

A backslash followed by anything else is searched for as it is.

For example, find ,\t and replace with ;\n to turn every comma followed by a tab into a semicolon and a new line. Find in Files has an Extended box that works the same way.

Regular expressions

Turn on .* to search with a regular expression. Ettin Edit uses the syntax of the Rust regex library, which is close to Perl's and Python's, except that look-around ((?=…), (?<=…)) and back-references inside the pattern aren't supported.

PatternMatches
\d+One or more digits
^\s+$A line holding only spaces or tabs (^ and $ are line starts and ends)
colou?rcolor or colour
(\w+)@(\w+)\.comAn address such as ann@example.com, with two groups
(?<year>\d{4})-(?<month>\d\d)A date, with named groups
(?s)begin.*?endbegin to the nearest end, across lines

In the replacement:

WriteTo insert
$1 or \1The first group ($2, \2 and so on for the others)
${name}A named group
$0The whole match
\n, \tA line break, a tab (\r and \r\n are a line break too)
$$A dollar sign
\\A backslash

For example, find (\w+), (\w+) and replace with $2 $1 to turn Lovelace, Ada into Ada Lovelace.

Finding everything at once

These are in the Search menu and the find bar's … menu:

  • Find All in Current Document lists every matching line in the results panel at the bottom.
  • Find All in Open Tabs does the same for every tab.
  • Select All Matches puts a caret on every match, so you can edit them all at once (see multiple carets).
  • Mark All highlights every match in a different colour that stays after you close the find bar. Mark All and Bookmark Lines also bookmarks each line with a match. Clear All Marks removes the highlights.

Find in Files

Search > Find in Files… (Ctrl+Shift+F) searches every file in a folder:

  • Find what: the text or regular expression, with the same Match case, Whole word and Regular expression options as the find bar.
  • Folder: where to look. Browse… picks one.
  • Files: which files, as patterns separated by spaces or semicolons, such as *.rs *.toml. Start a pattern with ! to leave those files out, for example *.js !*.min.js. Leave it empty for every file.
  • Include subfolders and Include hidden files and folders.

The search runs in the background, so you can keep working; Stop ends it early. Binary files are skipped.

You can also start Find in Files from the folder workspace: right-click a folder and choose Find in Files Here….

The results panel

Find All and Find in Files show their results in a panel below the text, grouped by file, with the matching words highlighted.

  • Click a line to jump to it; the file opens if it isn't open yet.
  • Click a file's heading to fold its results away; Collapse All and Expand All do every file.
  • × closes the panel.

Go to Line

Search > Go to Line… (Ctrl+G), or a click on Ln, Col in the status bar, asks for a line number. Type 120 to go to line 120, or 120:15 for line 120, column 15.

Bookmarks

Bookmarks mark lines you want to come back to. A bookmarked line shows a marker in the gutter.

Command (Search > Bookmark)Shortcut
Toggle Bookmark (or click the gutter)Ctrl+F2
Next BookmarkF2
Previous BookmarkShift+F2
Clear All Bookmarks

The same submenu works on the bookmarked lines as a group: Cut, Copy or Remove Bookmarked Lines, Remove Unbookmarked Lines (keep only the bookmarked ones), and Inverse Bookmarks.

Together with Mark All and Bookmark Lines, that gives a quick way to pull out every line that matches something: mark them, then Copy Bookmarked Lines and paste them into a new tab.

Views, panels and navigation

Everything in this chapter is in the View menu unless it says otherwise.

What the editor shows

CommandShortcutWhat it does
Word WrapAlt+ZWrap long lines at the window's edge instead of scrolling sideways. Line numbers stay with their lines, and the top line stays in place when you resize the window, even in very large files.
Line NumbersThe numbers in the gutter
Highlight Current LineA band behind the caret's line
Show Symbol > Show WhitespaceA dot for each space and an arrow across each tab
Show Symbol > Show End of LineLF, CRLF or CR at each line end
Show Symbol > Show Invisible CharactersA small label for each character you otherwise couldn't see (see below)
Show Symbol > Show All CharactersWhitespace, line ends and invisible characters together; choose it again to hide them all
Show Symbol > Indent GuidesFaint lines at each indentation level
Long-Line MarkerA vertical line at a column, 80 unless you change it

Show Invisible Characters labels characters that look like nothing, or like an ordinary space, so they can't hide in your text:

LabelCharacter
NUL, SOH … US, DEL, C1Control characters, such as ESC (character 27)
NBSP, NNBSPNo-break space and narrow no-break space
SP, MMSP, IDSPOther spaces (en, em, thin, hair and so on, medium mathematical, ideographic)
ZWSP, ZWNJ, ZWJ, WJZero-width space, non-joiner, joiner and word joiner
SHYSoft hyphen
LRM, RLM, ALM, LRE, RLE, PDF, LRO, RLO, LRI, RLI, FSI, PDIText direction marks and controls
BOMA byte-order mark (zero-width no-break space) inside the text
LS, PSUnicode line and paragraph separators
VS, CGJ, TAG, INV, HF, MVS, IAC, DEPRVariation selectors and other invisible formatting characters

Without it, control characters still show as small symbols, but the other characters in the table look like a space or like nothing at all.

Change the long-line column at the bottom of the Settings menu or in Preferences. Edit > Line Operations > Split Lines at Long-Line Column (Ctrl+I) rewraps text to that width.

Zoom

Zoom In (Ctrl+= or Ctrl++), Zoom Out (Ctrl+-) and Reset Zoom (Ctrl+0) change the size of the text. The status bar shows the zoom level. To change the size Reset Zoom returns to, set the font size in Preferences.

Code folding

Folding hides a block of code, such as a function or an if, behind its first line. Blocks follow the language's grammar: brackets, HTML and XML tags, keyword blocks such as if … end, Markdown headings, comment blocks and #region markers. Python, YAML and plain text fold by indentation. The full list is in Languages.

  • Click − in the gutter to fold a block and + to unfold it. A line in the gutter shows where each block starts and ends.
  • The block's closing line stays visible, so } else { folds each half.
Command (View > Folding)Shortcut
Fold AllAlt+0
Unfold AllAlt+Shift+0
Fold Current Level (the block the caret is in)Ctrl+Alt+F
Unfold Current LevelCtrl+Alt+Shift+F
Fold Level 1 to 5 (every block at that depth)Alt+1 … Alt+5

Split view

Split view shows two tabs side by side, or one tab twice.

  • Move to Other View moves the current tab to the other side, splitting the window if it isn't split yet.
  • Clone to Other View shows the same document on both sides. Each side has its own caret and scroll position, and an edit on one side appears on the other at once. Closing one copy leaves the other open.
  • Each side has its own tab bar and current tab. Click a side, or press F8 (Focus Other View), to work in it.
  • Drag the divider to change the sizes.
  • When one side has no tabs left, the split ends.

Both commands are also on the tab's right-click menu. The split is saved with the session. Compare uses the two views too: with the window split, Ctrl+Alt+D compares the two tabs you see.

Function List

View > Function List opens a panel on the right listing the functions, classes, methods and other parts of the document, nested the way they are in the code. It understands about 40 languages, including Markdown headings, INI sections and the keys of JSON and YAML files.

  • Click an entry to jump to it.
  • Type in Filter to find one by name.
  • Show where the caret is keeps the entry you're in selected as you move around.

Character Panel

View > Character Panel opens a table of characters on the right, with each one's decimal and hex code, HTML entity and Unicode name, like Notepad++'s ASCII Codes Insertion Panel.

  • Pick a block in the list: ASCII, Latin-1 Supplement, Greek and Coptic, Arrows, Box Drawing, Currency Symbols and others.
  • Or search: type a character (é), a code (U+00E9, 0xE9, 233, &eacute;) or words of its name (e acute, rightwards arrow, smiling face). The search covers every character up to the emoji.
  • Double-click a row to insert the character at the caret, or at every caret. The second list chooses what is inserted: the character, the HTML entity (&eacute;), the code (U+00E9) or the decimal code (233).
  • Right-click a row to copy the character, its HTML entity or its code.

Hex View

View > Hex View (Ctrl+Alt+Shift+H) shows the current tab as the bytes it's saved as, in its encoding and with its line endings: the offset of each row on the left, sixteen bytes in hex in the middle, and the same bytes as text on the right, where anything that isn't a printable ASCII character is a dot. Choose it again to go back to the text. Each tab remembers whether it's in hex until you close it.

The bar at the bottom shows the offset of the byte at the cursor (in hex and decimal), its value in hex, decimal and binary, how many bytes are selected, and the size of the file.

KeysWhat they do
Arrows, PageUp, PageDownMove the cursor; with Shift, select bytes
Home / EndStart or end of the row; with Ctrl, of the file
0–9, A–FType a byte in hex: the first digit waits for the second, then the byte under the cursor is replaced
TabSwitch between the hex and text columns. In the text column, typing a character replaces the bytes under the cursor with that character's bytes
Delete / BackspaceRemove the selected bytes, or the byte at or before the cursor
InsertInsert a 00 byte at the cursor, to type over
Ctrl+CCopy the selected bytes as hex, such as 48 65 6C
Ctrl+VPaste hex digits over the bytes at the cursor (or over the selection)
Ctrl+Z / Ctrl+YUndo and redo, shared with the text

Every change goes into the tab's text, so Undo works across both views and Save writes the bytes you see.

Changing any byte

You can type any byte anywhere, even one that leaves the text invalid in the tab's encoding. For example, in a UTF-8 file, typing over the first byte of é (C3 A9) leaves half a character, and a lone 0D in a file whose line endings are CR LF would be saved differently. When that happens, the tab is edited as bytes: the bar says so, and Save writes exactly the bytes shown. Undo the change, or finish it (type the second byte of a new character, say), and the tab goes back to being text as soon as its bytes are valid again.

While a tab is edited as bytes it stays in Hex View. Choosing View > Hex View again shows it as text if its bytes read as text in its encoding (or in one Ettin Edit can work out from them); otherwise the bar says why it stays. Encoding > Reopen With reads the file as text in the encoding you pick, whatever its bytes (see Encodings).

Binary and very large files

Files that look like binary data rather than text (images, programs, archives: anything with a 00 byte near the start that isn't UTF-16) open straight into Hex View, edited as bytes, without being read as text first. Files up to 64 MB are read into memory; bigger ones are read from disk as you scroll, so even a file of several gigabytes opens at once and changing a byte in it is instant.

Saving writes to a new file next to the old one and then puts it in place, so the file is never half written. For files over 64 MB, Undo starts again after saving. Unsaved changes to files up to 64 MB come back next time like any other tab's; for bigger files, Ettin Edit asks whether to save them when you quit. Copy copies at most 16 MB.

Markdown Preview

View > Markdown Preview (Ctrl+Shift+M, or the Markdown button on the toolbar's View tab) shows the Markdown tab you're editing, rendered, in a panel on the right: headings, lists, tables, quotes, code blocks, links, bold, italic and strikethrough, drawn like the user manual. It updates a moment after you stop typing, keeps its place as you edit, and follows you when you switch tabs. Press the shortcut again, or click × on the panel, to close it.

  • Click a web link to open it in your browser, a link to a heading (#install) to scroll there, or a link to another file (notes.md) to open it in a tab.
  • Images show: PNG, JPEG, GIF, BMP, WebP and SVG, from files next to the Markdown file (![Logo](img/logo.png)) or from the web. An image that can't be found or read shows its description instead. Images in an unsaved tab only load from the web, as there's no folder to look in yet.
  • To keep the preview off the network, untick Load images from the web in Settings > Preferences > Appearance > Markdown Preview. Web images then show their description, and pointing at one says why. Images from files still show.
  • The preview scrolls along with the text: scroll the editor and the preview shows the same place. Untick Scroll with the text at the top of the preview to scroll it on its own.
  • YAML front matter (the --- block some sites put at the top) isn't shown.
  • Raw HTML is left out.
  • Tabs that aren't Markdown (by language, or a .md / .markdown name) show a note instead. Tabs over 2 million characters aren't previewed, so typing stays smooth.

Before Ettin Edit 2.3 the preview was a sample plugin; it's still a sample, Markdown Preview (plugin example), for anyone who wants to see how it's done as a plugin.

Document Map

View > Document Map shows the whole document in miniature on the right, with the part on screen marked. Click or drag in it to scroll. It's a quick way to find your place in a long file.

Folder as Workspace

File > Open Folder as Workspace… opens a folder as a tree on the left, for working on a project. View > Folder as Workspace shows or hides the panel, and File > Close Workspace closes the folder.

  • Click a file to open it. The tree follows the current tab, and notices files being added or removed by itself.
  • The panel's buttons collapse every folder, read the folder again, and Show hidden files.
  • Right-click an entry for Open, Copy Path, Find in Files Here… and Open Terminal Here.

The workspace is remembered next time you start Ettin Edit.

Distraction-free mode

View > Distraction-Free Mode (F11) goes full screen and hides the menus, tabs, panels and status bar, leaving the text in a centred column. Press F11 again to come back. Shortcuts and the command palette (F1) still work.

Tab list

View > Tab List…, or the ⏷ button at the end of the tab bar, lists every open tab. Type part of a file or folder name to narrow the list, then press Enter or click a tab to switch to it.

Command palette

View > Command Palette… (F1) lists every command in every menu, your recipes, your saved macros and your plugins' commands, each with its shortcut. Type a few letters of any words in its name, in any order, then press Enter.

Each command shows its name first and, dimmer and smaller, where it is: the menu (Transform › JSON and XML), Recipe · 3 steps, or Plugin · name. The list is in this order:

  1. Commands you used recently (the last 20, newest first), marked recent.
  2. Commands whose name starts with what you typed.
  3. Commands with a word in the name that starts with it.
  4. Commands whose name contains it.
  5. Commands where only the menu path matches.

Commands that can't run in this tab (such as Convert to JSON on a tab that is already JSON) are dimmed, marked not for this tab and listed last.

Right-click a command and choose Copy Command ID to copy the id a plugin uses to run it.

Encodings and line endings

A text file is just bytes; its encoding says which bytes mean which characters. Today almost everything is UTF-8, but older files, and files from some Windows programs, use other encodings. Ettin Edit reads and writes all the common ones.

How Ettin Edit picks an encoding

When a file opens, Ettin Edit looks for, in order:

  1. a byte-order mark (BOM) at the start, which names UTF-8 or UTF-16 for certain;
  2. text that is valid UTF-8;
  3. UTF-16 without a BOM;
  4. failing those, the most likely legacy encoding, such as Windows-1252, Windows-1251 or Shift_JIS.

The encoding is shown on the status bar, and the file is saved in the same one, with or without a BOM just as it was. If some bytes don't make sense in the encoding it chose, Ettin Edit says so and shows them as �. Saving would replace them with �, so if the text looks wrong, use Reopen With (below) first.

Binary files (with a 00 byte near the start that isn't UTF-16) aren't read as text at all: they open in Hex View.

The Encoding menu

Open it from the menu bar or by clicking the encoding on the status bar.

Save as (the top of the menu) changes the encoding the tab will be saved in. The text you see doesn't change; the next save writes it in the new encoding. The choices are:

  • UTF-8, UTF-8 with BOM, UTF-16 LE and UTF-16 BE;
  • about 35 older encodings, grouped by region: Western European (Windows-1252, ISO-8859-1, ISO-8859-15, Mac Roman…), Central European, Cyrillic (including KOI8-R and KOI8-U), Greek, Turkish, Baltic, Nordic, Hebrew, Arabic, Vietnamese, Thai, Romanian, Chinese (GBK, GB18030, Big5), Japanese (Shift_JIS, EUC-JP, ISO-2022-JP) and Korean (EUC-KR).

If the text contains a character the new encoding can't hold, such as € in ISO-8859-1, saving stops and tells you which character and where. Nothing is lost.

Reopen With reads the file from disk again in the encoding you pick. Use it when Ettin Edit guessed wrong and the text looks garbled, for example é where there should be é. It's only available for saved files, and you can undo it.

New tabs use the encoding set in Preferences > New Documents, UTF-8 unless you change it.

Line endings

Lines end with LF on Linux and macOS, and CR LF on Windows; very old Mac files use CR. Ettin Edit detects the ending a file uses and keeps it when saving, so editing a Windows file on Linux doesn't change every line.

Click the line ending on the status bar, Unix (LF), Windows (CR LF) or Macintosh (CR), to convert the whole document to another. View > Show Symbol > Show End of Line shows each line's ending.

New tabs use the line ending set in Preferences > New Documents: your system's usual one unless you change it.

Text in other scripts

Ettin Edit's own fonts cover Latin, Greek and Cyrillic. For other scripts it uses fonts installed on your system:

  • Chinese, Japanese and Korean: Noto Sans CJK or WenQuanYi on Linux, Microsoft YaHei, Yu Gothic or Malgun Gothic on Windows.
  • Bangla, Hindi and the other Indian scripts, Sinhala, Thai, Lao, Khmer, Myanmar, Tibetan, Ethiopic, Armenian and Georgian: the Noto or Lohit font for the script on Linux, or any font fontconfig says covers it; Nirmala UI, Leelawadee UI, Myanmar Text, Microsoft Himalaya, Ebrima and Segoe UI on Windows.

Letters that join, such as Bangla and Hindi conjuncts and vowel signs, are drawn joined, and the arrow keys move over a joined letter as one.

If a script shows as boxes, no installed font covers it: see Troubleshooting. Right-to-left scripts (Arabic, Hebrew) aren't laid out right to left yet.

Macros

A macro records what you do in the editor and plays it back, so a repetitive edit only has to be done once. Macros are in Transform > Macros, next to recipes; the top of each submenu says how they differ:

  • Macros replay keystrokes and edits, from wherever the caret is.
  • Recipes replay transforms on a selection, a document or every tab, and can run from the command line.

Recording and playing back

  1. Put the caret where the first edit starts.
  2. Choose Transform > Macros > Start Recording (Ctrl+Shift+R). The status bar shows ● Recording macro.
  3. Make the edit: type, move with the keyboard, use the clipboard, and use commands such as Find Next, line operations or case conversion.
  4. Choose Transform > Macros > Stop Recording (Ctrl+Shift+R again).
  5. Choose Transform > Macros > Playback (Ctrl+Shift+P) to do it all again from wherever the caret is.

The trick is to finish the recording where the next run should start, for example at the beginning of the next line. Use keys rather than the mouse while recording; mouse clicks aren't recorded.

Example: to wrap every line of a list in quotes and add a comma, put the caret at the start of the first line and start recording. Type ", press End, type ",, then press Down and Home. Stop recording. Now each playback does the next line, and Run a Macro Multiple Times does the rest.

Running a macro many times

Transform > Macros > Run a Macro Multiple Times… plays the current macro a number of times you choose, or with Run until the end of the file until the caret reaches the last line.

Saving macros

The current macro is forgotten when you record a new one or quit. To keep it, choose Transform > Macros > Save Current Macro… and give it a name. Saved macros:

  • appear at the bottom of Transform > Macros, ready to play,
  • are in the command palette,
  • can have a keyboard shortcut of their own: find the macro in the Shortcut Mapper and click Set…,
  • are kept between sessions.

Transform > Macros > Delete Saved Macro removes one.

Turning a macro into a recipe

When everything you recorded is a transform (sorting, trimming, case changes, Replace All, anything in the Transform menu), Transform > Macros > Save Macro as Recipe… turns the macro into a recipe with the same steps and opens it in the Recipes window, ready for a name. Replace All keeps the find bar's text and options as they were when you recorded it.

If the macro has anything else in it, such as typing or moving the caret, the item is greyed out and its tooltip names the first step that can't be a recipe step, for example Can't become a recipe: typing “xy” isn't a transform.

Macros or recipes?

A macro replays keys and commands from wherever the caret is, which suits edits that move through the text. When the job is turning a whole selection or document into something else (replace this, keep those lines, sort, convert to JSON), a recipe is usually the better fit: it shows a preview, can be edited step by step, runs on all open tabs or from the command line, and is a file you can share.

Printing and exporting

Printing

File > Print… (Ctrl+P) opens the document in your web browser's print preview, where you choose the printer, page size, margins and which pages to print. Using the browser means printing works the same on every system and you get a proper preview.

The printout keeps the syntax colours, darkened so they read well on white paper. If you use a dark theme, the colours of Ettin Light are used instead, so you don't print a page of black ink. Line numbers are printed in the margin.

Both can be turned off in Preferences, under Files and Startup > Printing: Print line numbers and Print syntax colours.

To save a PDF, choose Save as PDF (or Microsoft Print to PDF) as the printer in the browser's print dialog.

Export as HTML

File > Export as HTML… saves the document as a web page with the current theme's colours and font, ready to put on a website or attach to an email. Line numbers are included when they're turned on in the View menu.

Transforming text

The Transform menu holds everything that turns text into other text: filter it through a shell command, sort, filter and number lines, change case, convert data between formats, encode, decode and hash, and format JSON and XML. Ettin Edit is built around it, so it is also the first thing on the toolbar's Home tab and in the right-click menu.

Every command works on the selection (each one, if there are several) or on the whole document when nothing is selected, and is one undo step. Commands that work on lines take every line a selection touches, so you don't have to select them exactly. If a command can't finish, a message says why and the text is left as it was.

To run several of these commands one after another, again and again, save them as a recipe.

Try before you apply

The dialogs show what they will do before they change anything:

  • Keep or Remove Matching Lines marks the lines in the editor as you type: lines that stay are green, lines that go are red and struck through. The dialog sits at the top right so the lines stay in view, and the marks go away when you press Cancel (or Esc). The marks follow your typing after a short pause; on files over 50,000 lines only the lines on screen are marked and the count is worked out in the background.
  • Add Prefix and Suffix, Number Lines and Reflow Paragraphs show an Input and an Output pane, worked out on the first 200 lines as you change the settings.
  • Filter Through Command shows the same two panes, but runs the command only when you press Preview (or Run), never while you type. The Output pane says how long the command took and its exit code; if it failed, it shows the command's error output instead.

Keep Matching Lines with ERROR typed: lines 1 and 4 are green, lines 2, 3 and 5 are red and struck through, and the dialog says 2 of 5 lines kept

Result goes to

Every one of these dialogs asks where the result goes:

ChoiceWhat happens
This tabThe result replaces the text, as one undo step
New tabThe result opens in a new tab with the same language; this tab is left exactly as it was
ClipboardThe result is copied; this tab is left exactly as it was

Each dialog remembers your last choice. Filter Through Command starts on New tab, so a command that does something unexpected can't spoil your text, and when its preview failed, This tab can't be picked.

Filter Through Command with sort | uniq -c | sort -rn: the Input pane shows the log lines, the Output pane shows them counted, with the run time and exit code 0 above it, and Result goes to set to New tab

The Transform menu

The Transform menu with Lines open: Keep Matching Lines, Count Distinct Lines, Sort Lines, Remove Duplicate Lines, Trim, Add Prefix and Suffix, Number Lines, Reflow Paragraphs and Tabs to Spaces

At the top:

  • Filter Through Command… (Ctrl+Alt+P), described below.
  • Recipes: run, record and manage recipes.
  • Macros: record and play back macros.

Then one submenu for each kind of transform:

SubmenuWhat's in it
Find and ReplaceReplace… (Ctrl+H), the find bar with the replace field
LinesKeep or remove matching lines, count distinct lines, sort, reverse, remove duplicate and empty lines, trim, join, add a prefix and suffix, number, reflow, tabs and spaces
Columns and FieldsExtract Matches, Align Columns, Select Fields, Sort Lines by Field, Split Lines At, Join Lines With, Escape String, Unescape String and Unix Time (Columns and fields)
Convert Case ToUPPERCASE, lowercase, Title Case, Sentence case, iNVERT cASE, and the identifier cases
Convert toJSON, YAML, TOML, XML, CSV and Markdown table
Encode and HashBase64, URL, Quoted-Printable, HTML and SAML (MIME Tools), Text to Hex, Hex to Text, Decode JWT, and Hash
JSON and XMLFormat, Minify and Sort Keys for JSON; Format, Linearize, Escape and Unescape for XML

The groups are the same ones the recipe window's Add Step button offers, so a step is where you'd look for it in the menu. When plugins add transforms, a Plugin Transforms submenu lists them, under each plugin's name (see Plugin transforms).

The Tools menu keeps the tools that look at text without changing it: Compare, CsvQuery, JSON Tree, Validate JSON, the XPath panel, Check XML Syntax, Validate XML and XSL Transform (which opens its result in a new tab).

The right-click menu

Right-clicking in the text shows Cut, Copy and Paste, then the commands that fit what you clicked:

  • On a selection: Convert Case To, Encode / Decode, Sort Lines, Remove Duplicate Lines and Filter Through Command.
  • In a JSON file: Format JSON, Minify JSON, Sort JSON Keys, Convert to, and JSON Tree.
  • In an XML file: Format XML, Convert to, and the XPath Panel.
  • In a CSV file: Open in CsvQuery and Convert to.
  • Plugin Transforms: the plugin transforms made for the tab's language, such as Explode HL7 Segments in an HL7 file.

Below them are the whole Transform menu, Recipes, and More Edit Commands (the rest of the Edit menu).

The right-click menu on a selection: Cut, Copy, Paste, then a Selection section with Convert Case To, Encode / Decode, Sort Lines, Remove Duplicate Lines and Filter Through Command, then Transform, Recipes and More Edit Commands

Filter through a command

Transform > Filter Through Command… (Ctrl+Alt+P) sends the text to a shell command and puts the command's output in its place, in a new tab or on the clipboard (Result goes to). Press Preview to see the output first. Anything that reads standard input and writes standard output works: sort -u, jq ., column -t, awk '{print $2}', python3 -c "…" and so on.

  • On Linux the command runs with sh -c; on Windows with cmd /C. To use another shell, such as bash -c or pwsh -Command, set Shell for commands in Preferences > Transform.
  • It runs in the file's folder (your home folder for a new tab), and the environment variable ETTIN_FILE holds the file's path.
  • The text goes to the command as UTF-8 with \n line breaks, and its output is read as UTF-8. When the selection doesn't end with a line break, a final line break in the output is dropped, so the text around it stays put.
  • While the command runs, the dialog shows it with a Stop button. Nothing changes until it finishes. A preview runs in the background and changes nothing at all.
  • If the command fails (a non-zero exit code), the dialog shows its error output and the text stays as it was.
  • Recent commands in the dialog lists the last 15 commands you ran.
  • In the Flatpak, commands run on your computer outside the sandbox, so your own tools are found.

Lines

Transform > Lines:

CommandWhat it does
Keep Matching Lines… (Ctrl+Alt+K)Keeps only the lines that contain the text you type, like grep
Remove Matching Lines…Removes those lines instead, like grep -v
Count Distinct LinesOpens a new tab with each different line once and how many times it appears, most frequent first, as count, a tab, then the line
Sort LinesThe sorts described below
Reverse Line OrderFlips the lines without sorting
Remove Duplicate Lines and the other Remove commandsDescribed below
TrimTrim Leading and Trailing Space, Trim Trailing Space, Trim Leading Space
EOL to SpaceJoins the lines with a space between them
Add Prefix and Suffix…Adds text to the start and end of each line, for example ' and ', to turn a list into SQL values. Skip empty lines leaves blank lines alone
Number Lines…Puts a number in front of each line: pick the first number, the step, the text after the number (. by default), and whether numbers are aligned with spaces, padded with zeros, or neither
Reflow Paragraphs…Rewraps paragraphs so no line is longer than the width (the long-line column from Preferences, unless you change it)
Tabs to Spaces, Leading Spaces to Tabs, All Spaces to TabsUse the tab width from Preferences

The same commands are also in Edit > Line Operations.

The matching-lines dialog has Match case and Regular expression options, shows how many lines it keeps as you type, and marks the lines green and red in the editor (Try before you apply). Regular expressions use the same syntax as Find.

Reflow joins the lines of each paragraph and breaks them again at spaces. A paragraph ends at a blank line or at a list item (-, *, + or 1.). Indentation, comment markers (//, #, >, --, ;) and list bullets are kept, and continuation lines of a list item line up under its text. A word longer than the width stays whole on its own line.

Sorting and removing lines

Sorting, reversing and removing lines work on the selected lines, or on the whole document when nothing is selected. Everything is one undo step.

Sorting, ascending or descending:

  • Lexicographically: in character order, so B comes before a.
  • Ignoring Case: a and A together.
  • As Integers and As Decimals: by the number at the start of each line, so 9 comes before 10. Lines without a number go first.
  • Naturally (file2 before file10): the way a person would, comparing runs of digits by their value and letters ignoring case, so file2 comes before file10 and v1.9 before v1.10.
  • By Length: shortest first.
  • Reverse Line Order flips the lines without sorting.

Removing lines:

  • Remove Duplicate Lines keeps the first copy of each line.
  • Remove Consecutive Duplicate Lines only removes repeats that follow each other, like the Unix uniq.
  • Remove Empty Lines removes lines with nothing on them; Including Blank Ones also removes lines that only hold spaces or tabs.

Case

Transform > Convert Case To (also in the right-click menu on a selection, and under Case on the toolbar's Home tab):

CommandShortcutExample
UPPERCASECtrl+Shift+UHELLO WORLD
lowercaseCtrl+Uhello world
Title CaseAlt+UHello World
Sentence caseCtrl+Alt+UHello world
iNVERT cASECtrl+Alt+Shift+UhELLO wORLD

Below them are the identifier cases, which turn each line into one name.

Identifier case

The identifier cases at the end of Transform > Convert Case To turn each line into one name in a programming style. The words are found wherever the text has spaces, punctuation, _, - or a change of case, so parse HTTP request, parseHttpRequest and PARSE_HTTP_REQUEST all become:

CommandResult
camelCaseparseHttpRequest
PascalCaseParseHttpRequest
snake_caseparse_http_request
kebab-caseparse-http-request
CONSTANT_CASEPARSE_HTTP_REQUEST

With nothing selected they convert the word at the caret, like the other case commands.

Converting data

Transform > Convert to converts between JSON, YAML, TOML, XML and CSV, and writes Markdown tables. You only pick the format you want: Convert to > YAML, Convert to > Markdown table and so on. Ettin Edit works out what the text is in now, and the top of the menu says so ("Reading this tab as JSON"). After a conversion the status bar says what happened, for example Converted to YAML (read as JSON).

How it tells: a tab whose language is JSON, YAML, TOML, XML or CSV is read as that. Otherwise it tries JSON, XML, TOML, YAML and CSV in that order on the selection (or the whole tab) and takes the first that fits. Because nearly any text is valid YAML or CSV, YAML only counts when it is a list or a set of key: value lines with plain keys, and CSV only when at least two lines have the same number of commas (or tabs, semicolons or |).

The format the text is already in is greyed out, and so is everything when the text doesn't look like any of them, such as a log file or prose. In a very big file (over 2 MB) the format is worked out when you open the menu, and a Reading this tab… line shows while that takes a moment.

Convert to > Read as picks the format yourself when the guess is wrong or the text isn't one of the formats yet: Auto (the guess, shown in brackets), JSON, YAML, TOML, XML or CSV. The choice is for that tab, and goes back to Auto once the whole tab has been converted.

The Convert to button on the toolbar's Home tab opens the same menu, and the Convert group on the Transform tab has the same targets (To JSON, To YAML and so on), greyed out the same way. In the command palette they're called Convert to JSON, Convert to YAML, and so on.

When the whole document is converted, the tab's language switches to the new format; the file name doesn't change until you save it under another name. Keys keep their order. JSON and XML are indented with the tab width and the tabs-or-spaces setting from Preferences.

How each format maps to the others:

  • YAML: keys that aren't text (1:, true:) become text keys. A file with several documents (---) can't be converted in one go; select one.
  • TOML needs a table at the top. A list becomes [[item]] tables. TOML has no null, so keys that are null are left out, and a null inside a list stops the conversion. Dates become text in the other formats.
  • XML to the others: the root element becomes the one key at the top. Attributes become keys starting with @, repeated child elements become a list, text next to attributes or child elements goes in #text, and an empty element becomes null.
  • The others to XML works the same way back. When the top isn't a single key, it's wrapped in <root>; keys that can't be element names have the odd characters replaced by _.
  • CSV to the others: the first row names the columns, and each row becomes an object. The delimiter and quotes are detected as in CsvQuery; columns that are all numbers become numbers, but values with leading zeros, such as zip codes, stay text.
  • The others to CSV or Markdown: a list of objects becomes one row each, with a column for every key that appears. A list of lists is used as it is, the first one being the header. An object that holds just one list is treated as that list. Values that are themselves lists or objects are written as JSON in their cell.

Hashes

Transform > Encode and Hash > Hash has MD5, SHA-1, SHA-256, SHA-512 and CRC32.

  • With a selection, each selection is replaced by its hash.
  • With nothing selected, the hash of the whole document is copied to the clipboard and shown, and the text is left alone. To open it in a new tab instead, set Hash with no selection in Preferences > Transform. It's worked out from the text in UTF-8 with the document's line endings, so for a UTF-8 file it matches sha256sum and friends.

Hashes are written in lower-case hex.

Hex and JWT

In Transform > Encode and Hash:

  • Text to Hex writes the text's UTF-8 bytes as hex pairs: Hé becomes 48 C3 A9.
  • Hex to Text reads them back. Spaces, line breaks, commas, colons and 0x or \x in front of bytes are all fine. If the bytes aren't UTF-8 text, use Hex View instead.
  • Decode JWT turns a JSON Web Token (a Bearer in front is fine) into JSON with its header and payload, and says when it was issued and when it expires, in your local time. The signature is not checked, so don't trust what a token says because it decoded.

Columns and fields

The Select Fields dialog: Fields 1, Delimiter comma, Keep these fields, Join with the same delimiter; Input shows four CSV lines with name, qty and city, and Output shows only the names

Transform > Columns and Fields works on text laid out in columns, such as CSV, logs and command output, and on bits of text that need to go into code. The commands with settings open a dialog with a live preview, like the others (Try before you apply).

A delimiter is the text between fields: , for CSV, \t for a tab, |, ; or anything longer. Leave it empty to split on runs of spaces and tabs, like most command output. With a one-character delimiter, a field in double quotes can hold the delimiter ("Paris, France"), as in CSV.

  • Extract Matches… puts every match of a regular expression on a line of its own, in a new tab by default: every error code in a log, every e-mail address in a page. Capture group takes a group instead of the whole match (id=(\d+) with group 1 gives the numbers). Each match once drops repeats and keeps the order they were found in.
  • Align Columns… pads the cells so the columns line up, the way column -t does. Lines without the delimiter are left alone, and indentation is kept. A space each side of the delimiter writes a | b instead of a|b.
  • Select Fields… keeps or removes fields by number: 2,1 swaps the first two, 3-5 is three to five, 4- is the fourth onwards and -2 the last two. Join with writes the fields with a different delimiter, which turns CSV into tab-separated text and back.
  • Sort Lines by Field… sorts the lines by one field: naturally, as text or as numbers, ascending or descending. Lines that don't have that field stay at the top in their order.
  • Split Lines At… breaks each line at every separator, so each piece is on a line of its own. Trim spaces and drop empty pieces tidies the result.
  • Join Lines With… joins the lines into one, with a separator and quotes around each: lines a, b, c with separator , and quote ' give 'a', 'b', 'c', ready for an SQL IN (…) list. A quote inside a line is doubled. Skip empty lines leaves blank lines out.
  • Escape String and Unescape String prepare text to go inside a string, or read it back, for JSON / JavaScript (\", \n, \u00e9), C / C++ / Java / C# (as JSON, plus \', \0, \xHH), SQL (' doubled), Regular expression (a backslash before every special character), Shell (the whole text in single quotes) and CSV (double quotes when needed). Unescape takes off the outer quotes when the language uses them.
  • Unix Time turns Unix times (10-digit seconds or 13-digit milliseconds) into ISO 8601 dates, in UTC or your local time, and ISO 8601 dates (2026-11-12T22:10:02Z, with an offset, or with a space for the T) back into Unix seconds or milliseconds. Everything else in the text stays as it is, so you can run it over a whole log.

Every one of these can be a recipe step, and macros record them.

Encoding, JSON and XML

Transform > Encode and Hash has the MIME Tools encodings and decodings, and Transform > JSON and XML formats, minifies and sorts JSON and formats, linearizes, escapes and unescapes XML. Each is described on its own page.

Plugin transforms

Plugins can add transforms of their own. They behave like the built-in ones:

  • They're in Transform > Plugin Transforms, the command palette and the Shortcut Mapper, and on the right-click menu of the languages they're made for.
  • They work on each selection, or the whole tab when nothing is selected, and one Undo reverses the lot.
  • A transform with options opens a dialog first: its options, a live preview of the first lines and Result goes to, as above. Reset to Defaults puts the options back. A transform without options runs straight away.
  • They can be recipe steps, and recording a recipe records them with the options you used.
  • If the plugin says where the text is wrong, the caret moves there and the message says so.

The plugin does the work in its own process. While it takes more than half a second, a message shows it with a Stop button; after 10 seconds Ettin Edit stops waiting and leaves the text as it was.

To write one, see Writing plugins.

Macros and plugins

Transform commands are recorded in macros with the settings you chose in their dialog, so a macro repeats exactly what you did. Filter Through Command is the exception: a macro never runs shell commands. Every Transform command is also in the Shortcut Mapper and the command palette.

Suggestions

When you open a file, or paste more than 1 KB of text, Ettin Edit looks at the start of it (the first 64 KB) and, if a transform would obviously help, says so in a thin bar above the text:

A bar above a one-line JSON file: This JSON is on one line (52 KB), with Format and Show as Tree buttons, and Don't suggest this again and a close button at the right

When the text is…The bar offers
JSON with almost everything on one line (more than 500 characters)Format and Show as Tree (JSON tools)
XML with almost everything on one lineFormat (XML Tools)
A JSON Web Token (three Base64 parts; the first a header with alg)Decode (Hex and JWT)
A block of Base64 that decodes to readable textDecode (MIME Tools)
Comma, tab or semicolon separated values, or a .csv fileOpen in CsvQuery (CsvQuery) and Show as Table (Tables)
A file with more than one kind of line breakFix: use LF or CRLF everywhere
A file indented with both tabs and spacesFix: tabs to spaces, or spaces to tabs

A tab shows at most one suggestion. It goes away when you use a button, close it with ×, or edit the text, and nothing happens unless you press a button. Ettin Edit is careful not to guess: prose, Markdown tables and short words that happen to be valid Base64 don't get a bar.

Don't suggest this again turns that kind of suggestion off for good. Settings > Preferences > Files and Startup turns all suggestions off, and Show the dismissed suggestions again brings back the ones you turned off.

Recipes

A recipe is a list of Transform steps saved under a name: find and replace, keep lines, sort, trim, convert to JSON, Base64, a shell command and so on. Run it and every step happens in order, as one undo step. Build it once, then use it on any file whenever the same clean-up comes round again.

Recipes live in Transform > Recipes (also in the right-click menu), in the Recipes group on the toolbar's Home and Transform tabs, and in the command palette.

Running a recipe

Pick it from Transform > Recipes. Like every Transform command it works on the selection (each one, if there are several) or on the whole document when nothing is selected. If a step fails, for example a JSON step on text that isn't JSON, a message names the step and why, and the text is left as it was.

Transform > Recipes > Run on All Open Tabs runs a recipe on the whole text of every open tab instead. Each tab changes as its own undo step; read-only tabs and tabs shown in Hex View are skipped.

A recipe can have a keyboard shortcut of its own: set it in the Recipes window (below), or find the recipe under Transform › Recipes in the Shortcut Mapper. Recipes are also in the command palette, shown as Recipe · 3 steps.

Each recipe has an id, like clean-api-dump-7f3a, made from its name the first time it is saved. Shortcuts and toolbar buttons use the id, so renaming a recipe keeps its shortcut and its toolbar button. (Shortcuts and buttons made before 2.0.2 used the name; Ettin Edit moves them to the id the first time it starts.)

The Recipes window

Transform > Recipes > Manage Recipes… (Ctrl+Alt+R) opens the Recipes window. Your recipes are listed on the left; pick one to see and change its steps on the right. Double-click a recipe to run it.

Drag the window's bottom-right corner to make it bigger; the preview panes take the extra room. The button at the right end of the bottom row (Fill the window) makes it as big as the Ettin Edit window, to see more of the input and output at once; click it again (Restore size) to go back.

  • Name and Description: the name is what the menus show; the description shows when you point at the recipe in the list.
  • Shortcut: click Set… and press the keys you want; Clear takes the shortcut away. If another command already has those keys, the window says which and offers Move It Here, as the Shortcut Mapper does. The recipe's id is shown under the shortcut.
  • Steps: click a step to open its settings. The tick box switches a step off without removing it, the arrows move it, and the cross removes it.
  • Add Step lists every step, by group (below). Type in the search box at its top to list every step whose name has those words, from all groups; the arrow keys move the highlight and Enter adds it.
  • Preview input picks the text the preview runs on: the Active tab (the selection, or the document) or Sample text you type or paste into the left pane. The sample is saved with the recipe (as "sample" in its file), so it travels with an export and is there next time.
  • Show output after picks the step whose result the right pane shows: The last step, or any step before it. Clicking a step picks it too, so you can walk through a recipe one step at a time. If a step fails, its message shows under that step and in the right pane.
  • The preview updates as you change any step. It uses the first 20,000 characters, and stops before a step that runs a shell command.

The Recipes window with Count Errors and Warnings selected: Preview input is set to Sample text, Show output after is Step 2, the sample pane holds INFO a, ERROR b, WARN c and the After step 2 pane shows ERROR b and WARN c

Every change is saved straight away. Undo Changes puts every recipe back as it was when you opened the window (recipes added since are removed, and deleted ones come back). The other buttons along the bottom make a New recipe, Duplicate, Delete, Export… or Import… one, and open the recipes Folder. Changes you make to the files there yourself show up within a second; Reload reads the folder again at once. Run and Run on All Tabs on the right run the recipe you're looking at. (If a translation makes the labels too long to fit, the buttons show only their icons; point at one to see what it does.)

Transform > Recipes > Run Last Recipe (also on the toolbar's Home tab) runs the recipe you ran last again on the active tab; its tooltip names it.

Recording a recipe

You can also make a recipe by doing the job once:

  1. Choose Transform > Recipes > Record Recipe. The status bar shows ● Recording recipe and how many steps it has so far.
  2. Run the commands you want, from the menus, the toolbar or their shortcuts.
  3. Choose Transform > Recipes > Stop Recording Recipe, or click the status bar message.

The Recipes window opens with the new recipe, ready for a name. Commands that change text become steps: everything in the Transform menu (including the same commands in Edit > Line Operations and on the toolbar). Replace All in the find bar becomes a find-and-replace step with the find bar's text and options. Typing, moving the caret and other commands aren't recorded; use a macro for those. A macro made only of transforms can become a recipe too: see Turning a macro into a recipe.

Recipes replay transforms and can run from the command line; macros replay keystrokes and edits. The top of each submenu in Transform says so.

The steps

Add Step offers the same groups, in the same order, as the Transform menu:

GroupSteps
Find and ReplaceReplace every match, with Match case, Whole word, Regular expression or Extended (\n, \t, \xNN), exactly as in the find bar. $1 or \1 put a group back
LinesKeep or Remove Matching Lines, Count Distinct Lines, Sort (lexically, ignoring case, as integers, as decimals, naturally or by length; ascending or descending), Reverse Line Order, Remove Duplicate Lines (all, or only repeats next to each other), Remove Empty Lines (and blank ones), Trim, Join Lines, Add Prefix and Suffix, Number Lines, Reflow Paragraphs, Tabs to Spaces, Spaces to Tabs
Columns and FieldsExtract Matches, Align Columns, Select Fields (or remove them), Sort Lines by Field, Split Lines At, Join Lines With, Escape String and Unescape String (JSON, C, SQL, regular expression, shell or CSV), Unix Time to Date and Date to Unix Time (Columns and fields)
Convert Case ToUPPERCASE, lowercase, Title Case, Sentence case, iNVERT cASE, camelCase, PascalCase, snake_case, kebab-case, CONSTANT_CASE
Convert toJSON, YAML, TOML, XML, CSV or a Markdown table. Read as is Auto (the format the text looks like when the step runs) or a format you pick. Recipes from 2.0.0 with a "from X to Y" step still run as before
Encode and HashEvery MIME Tools encoding and decoding, MD5, SHA-1, SHA-256, SHA-512, CRC32, Text to Hex, Hex to Text, Decode JWT
JSON and XMLJSON Format, Minify and Sort Keys; Format XML (with or without attributes on their own lines), Linearize, Escape and Unescape
CommandFilter Through Command: any shell command, as in Transform
Plugin TransformsThe transforms of the plugins that are running, under each plugin's name, with their options
TableMade by Save as Recipe… in a table tab: how the data is read, the table's steps, and the export. Change it in a table tab and save under the same name

A plugin transform step needs its plugin: if the plugin isn't installed, is turned off or isn't allowed to run, the recipe stops at that step and says which plugin it needs. The recipe window's preview stops before a plugin step, as it does before a Command step, and shows the text up to there.

A few steps behave a little differently inside a recipe, because a recipe always turns text into text:

  • Count Distinct Lines and Extract Matches replace the text with their result instead of opening a new tab.
  • A hash replaces the text with the hash, even when nothing is selected.
  • Case steps convert all the text, not just the word at the caret.
  • Line steps work on the text exactly as selected (the menu commands take every line a selection touches).

Recipes that run commands

A Command step runs a program on your computer, so a recipe with one always asks before it runs and lists the commands. Tick Don't ask again for this recipe until its commands change to skip the question next time; if anyone changes a command or the recipe's name, it asks again. A recipe with commands has a terminal sign after its name in the Recipes window.

If you write your own recipes and trust them, set Recipe command steps to Run without asking in Preferences > Transform. The shell they run with is Shell for commands in the same place.

While a recipe takes more than a moment, a message shows it with a Stop button. Stopping leaves the text as it was.

Macros never replay shell commands; recipes do, because they ask first.

The recipe files

Each recipe is a JSON file in the recipes folder of the settings folder, so you can copy, share, back up or edit recipes like any other file. Transform > Recipes > Open Recipes Folder opens it. Ettin Edit puts five sample recipes there the first time it starts: Tidy Whitespace, Unique Sorted Lines, Count Errors and Warnings, Lines to SQL IN List and CSV to Markdown Table. Change or delete them as you like; they don't come back.

A recipe file looks like this:

{
  "version": 1,
  "name": "Lines to SQL IN List",
  "id": "lines-to-sql-in-list-0c4e",
  "description": "Turns one value per line into IN ('a', 'b', 'c').",
  "steps": [
    { "op": "trim", "kind": "Both" },
    { "op": "remove_empty_lines", "blank": true },
    { "op": "replace", "find": "'", "replace": "''", "regex": true },
    { "op": "affix_lines", "prefix": "'", "suffix": "'," },
    { "op": "join_lines" },
    { "op": "replace", "find": ",[ \\t]*$", "replace": "", "regex": true },
    { "op": "affix_lines", "prefix": "IN (", "suffix": ")" }
  ]
}

Each step has an op and its settings; settings you leave out take their defaults, and "enabled": false switches a step off. An optional "sample" holds the recipe window's sample text. A file without an id gets one when Ettin Edit reads it (and it is written back), and so does a copied file whose id another recipe already has. A Convert to step looks like { "op": "convert_to", "to": "Yaml" }, with "from": "Json" when it reads the text as a set format. A plugin transform step looks like { "op": "plugin", "plugin": "hl7-viewer", "transform": "Explode HL7 Segments", "options": { "names": true } }. A table step holds how the data is read, the table's steps and the export: { "op": "table", "read": { "format": "csv", "delimiter": "," }, "steps": [ { "op": "change_type", "column": "Born", "kind": "date", "format": "DD/MM/YYYY" } ], "write": { "format": "excel", "sheet": "Patients" } }. The easiest way to learn the names is to build a recipe in the window and open its file. To share one, use Export Recipe…, or send the file; the other person uses Import Recipes… or drops it into their recipes folder.

From the command line

Recipes also run without opening a window, for scripts and batch jobs:

ettin-edit --recipe "Tidy Whitespace" < in.txt > out.txt
ettin-edit --recipe "Tidy Whitespace" notes.txt todo.txt > tidy.txt
ettin-edit --recipe "Tidy Whitespace" --in-place *.txt
ettin-edit --recipe my-recipe.json data.csv
ettin-edit --recipe "Ward report" export.xlsx --out report.xlsx
ettin-edit --list-recipes
  • --recipe takes a recipe's name (from your recipes folder, ignoring case), its id, or the path of a recipe file.
  • With no files it reads standard input. Files are written one after another to standard output, or changed where they are with --in-place (files the recipe doesn't change are left untouched).
  • A recipe with Command steps only runs with --allow-commands; without it, Ettin Edit lists the commands and stops.
  • Plugin transform steps start their plugin for the run, using the Python and Node.js set in Ettin Edit. The plugin must be one you allowed to run in the app.
  • --out FILE writes the result to a file instead of standard output, for one input. A recipe whose table step writes an Excel workbook needs it, and one that reads a workbook takes the workbook's file.
  • Files must be UTF-8 (except workbooks read by a table step); a byte-order mark and Windows line endings are kept.
  • If a step fails, the message goes to standard error and the exit code is 1 (2 for a mistake in the options).

On Windows, run it from PowerShell or a script, which wait for it to finish.

Recipes in plugins

Plugins can run a recipe with run_action({"RunRecipe": "Tidy Whitespace"}) (or RunRecipeOnAllTabs); see Writing plugins.

Tables

A table tab shows data as rows and columns, like a spreadsheet, so you can reshape an export from one system into what another system wants: pick and rename columns, read dates the way they were written, filter and sort rows, and write the result as CSV, an Excel workbook, JSON, YAML, XML, HL7 v2 messages or Markdown.

Every change you make is a step. The steps are kept in order on the right, can be switched off, changed or removed at any time, and can be saved as a recipe that does the same to next week's export, in the app or from the command line.

A table tab: a grid of patient rows with typed column headers, a Filters chip reading Ward is North, and a Steps panel on the right with Source, Born is Date and Rows where Ward is North

Opening data as a table

  • Excel and OpenDocument workbooks (.xlsx, .xlsm, .xls, .xlsb, .ods) open straight into a table tab, from File > Open…, the command line or by dropping them on the window. The workbook itself is never changed; use Export to write the result.
  • CSV, TSV, JSON, XML and HL7 v2: open the file as usual and press Ctrl+Alt+T (Table > Show as Table), or use File > Open as Table… to do both at once. When a file looks like CSV, the suggestion bar offers Show as Table too.
  • Any text tab can be shown as a table. Ctrl+Alt+T again (or Show as Text) goes back to the text; the table and its steps stay, and follow the text when you edit it.

Ettin Edit guesses how to read the data: the delimiter and whether the first row holds the column names for delimited text, the header row for a workbook, the list of rows for JSON and XML, and one row per message for HL7. The Source step at the top of the Steps panel says what it chose; click it (or Table > Import Options…) to change it, with a live preview:

DataOptions
Delimited textDelimiter (comma, tab, semicolon, pipe or any other character), quote character or none, first row has the column names
WorkbookSheet, and the row with the column names (rows above it, such as a report title, are skipped; 0 means there are no names)
JSONWhere the rows are, like data.items (empty to let Ettin Edit find them). Pick… lists every list in the file. Nested objects become columns with dotted names such as address.city; lists stay as JSON text
XMLWhich elements are the rows, like appointment or order.line (empty to find them). Attributes and child elements become columns
HL7 v2One row per message or per segment, whether fields are split into components, and which fields to copy into each row

Ettin Edit comes with made-up sample files to try all this on, in the samples/tables folder of the source: lab results in HL7, orders in JSON, appointments in XML and patients in CSV. Every name and number in them is invented. Detect column types is on by default.

Nested data

JSON and XML exports are trees: an order holds a clinic and a list of order lines, an appointment holds a patient with a name. A table needs rows, so you say which items are the rows, and the rest becomes columns:

Import Options for orders.json: Rows at orders.lines, Copy the fields of the items above into each row ticked, and a preview with one row per order line, each with its order's id, date, status and clinic

  • Rows at is a path of names separated by dots. When a path goes through a list, every item of it is followed, so orders.lines gives one row per order line across all the orders.
  • Copy the fields of the items above into each row (on by default) puts the order's own fields into each of its lines, named with the path, such as orders.id and orders.clinic.name. Untick it for just the lines.
  • Objects inside a row become dotted columns (clinic.address.city). Lists inside a row stay as JSON text, ready for Explode into Rows.

For XML, an element's attributes and child elements both become columns. An attribute keeps its plain name (id), or becomes @id when a child element has the same name. An element with only text, like <provider npi="1234567893">Dana Halvorsen, MD</provider>, gives a provider column for the text and provider.npi for the attribute. An element that appears more than once in a row, like several <reason> elements, becomes a list.

Explode into Rows and Flatten Objects

Two steps, in the column menu and the Table menu, finish the job:

  • Explode into Rows gives each item of a column its own row, with the other columns repeated. Leave Split at empty for a JSON list, or type a separator such as ;, | or \n (a line break) for a list written as text. An empty cell keeps its row.
  • Flatten Objects turns a column of JSON objects into a column per field: reason.code and reason.text for a column reason. Use it after exploding a list of objects. Cells that aren't objects stay in the column.

HL7 v2 messages

HL7 v2 files (.hl7, or any text whose lines start with MSH|) are read by Ettin Edit itself; the HL7 viewer plugin isn't needed. Each message becomes a row, and each field a column named the way HL7 people write it:

ColumnMeans
PID.5PID segment, field 5
PID.5.1PID field 5, component 1 (with Split fields into components)
PID.3.4.1a subcomponent
PID.3[2]the second repeat of PID field 3
OBX[2].5field 5 of the second OBX segment in the message

Point at a column's name to see what it is, such as Patient Identification › Patient Name › Family Name. Escape sequences such as \F\ and \.br\ are turned back into the characters they stand for.

Lab results as a table, one row per OBX segment, with the pointer on the PID.5.1 column and a tooltip reading Patient Identification, Patient Name, Family Name

Import Options for lab-results.hl7: Read as HL7 v2, one row per OBX segment, copy MSH.10, PID.3.1, PID.5.1 and PID.5.2 from the message, and a preview with nine result rows: glucose, creatinine, potassium and so on, each with its patient's name

Lab results are easier to work with as one row per result. In Import Options, set One row per to a segment, such as OBX segment:

  • Each row holds that segment's fields, plus the segments after it up to the next one, so a note (NTE) that follows a result is in the result's row.
  • Copy from the message lists the fields put into every row, such as MSH.10 (the message's control id), PID.3.1 and PID.5.1. Change it to any fields you like, separated by commas.

Column types

Each column has a type, shown as a small badge in its header:

BadgeTypeValues look like
abcTextanything
123Whole number42, -7
1.2Decimal3.25
dateDate2026-11-03
timeDate and time2026-11-03 08:12:00
y/nTrue/falsetrue, false

Detection is careful: a column of codes such as 000123 stays text, so the leading zeros survive. A value that doesn't fit its column's type is kept as it is and drawn in red, and the status bar counts them, so a stray n/a in a column of weights is easy to find.

Change Type… (in a column's menu, or Table > Columns) sets a column's type. For dates written another way, give a date pattern:

The Change Type dialog: column Born, type Date, date pattern DD/MM/YYYY, with a preview where the dates now read 1984-03-02 and so on

TokenMeans
YYYY / YYyear, four or two digits (YY 00–49 is 20xx, 50–99 is 19xx)
MM / Mmonth number
MMM / MMMMmonth name, short or long (Nov, November)
DD / Dday of the month
HH / Hhour, 0–23
hh / hhour, 1–12, with A
mmminutes
ssseconds
SSSfractions of a second (read and dropped)
AAM or PM

Anything else must appear as written: DD/MM/YYYY reads 02/03/1984, YYYYMMDD reads 19840302, D MMM YYYY h:mm A reads 3 Nov 2026 8:12 PM. Numbers can have fewer digits when a separator follows, so D/M/YYYY reads 2/3/1984 too. Dates are stored as YYYY-MM-DD and date-times as YYYY-MM-DD HH:MM:SS, so they sort properly and export cleanly.

For numbers, Decimal comma reads 1.234,5 as 1234.5. Thousands separators are dropped either way.

Changing the table

Click a column's name for its menu, or right-click it. The same commands are in the Table menu, on the ribbon's Table tab (which appears while a table is showing), in the command palette and in the right-click menu of a cell.

GroupCommands
ColumnsRename, Change Type, Duplicate, Flatten Objects, Move Left and Right, Remove, Choose Columns (tick the ones to keep and drag them into order)
ValuesReplace Values (in one column or all; whole cell, match case, regular expression), and Text: Trim spaces, Collapse spaces, UPPER CASE, lower case, Title Case
RowsSort Ascending, Sort Descending, Sort… (several columns), Filter Rows…, Explode into Rows, Remove Duplicates (rows that match on the columns you pick; the first is kept), Remove Empty Rows, Remove Row

Most commands open a small dialog with a preview of the result before you press OK. Empty cells always sort last.

Filter Rows… keeps the rows where a column is, is not, contains, starts with, is empty, is greater than and so on, or is one of a list of values you tick (with how often each appears). Right-click a cell for Keep only "North" or Hide "North" in one click. Filters show as chips above the grid; × on a chip removes that filter.

Editing cells

Double-click a cell, or select it and press Enter or F2, to type a new value; Delete clears it. A cell edit is a step too, but it picks its row by number, so it is marked by row number: on next week's data, row 12 may be someone else. Prefer Replace Values or a filter in steps you want to replay.

Finding

The Find in table box above the grid (Ctrl+F) highlights matching cells; Enter jumps to the next one. Column Statistics shows how many cells are filled, empty and distinct, how many don't fit the type, the smallest and largest values and the most common ones.

The Steps panel

The first step, Source, reads the data; each step after it changes the table. In the panel you can:

  • Click a step to see the table as it was after that step. A banner says so; Show the result goes back to the end. A new step is added after the one you're looking at.
  • Untick a step to switch it off and see the table without it.
  • Move it up or down, change it (pencil, or double-click) or delete it.

Renaming a column renames it in the later steps too. If a step can't run any more, for example because an earlier change removed its column, it says why in red and the steps after it are skipped; the table shows what came before.

Ctrl+Z and Ctrl+Y undo and redo changes to the steps.

Exporting

Export writes the table as (Ctrl+S opens it too, in a workbook tab or a table tab with changes):

FormatOptions
CSV / delimited textDelimiter, quote values when needed, always or never, write the column names, Windows line endings
Excel workbook (.xlsx)Sheet name. Numbers, dates and true/false are written as real Excel values, with a bold header row and fitted column widths
JSONA list of objects; indented or not, numbers and true/false as JSON values, empty cells as null. Dotted names as nested objects writes clinic.city as "clinic": { "city": … }
JSON LinesOne object per line, nested or not
YAMLA list of mappings, nested by dotted names (on by default)
XMLA root element (rows) holding one element per row (row). Dotted names nest elements (patient.name.family) and a name starting with @ is an attribute (@id, patient.@mrn). Empty values are left out unless you untick it
HL7 v2 messagesOne message per row, from a template (below)
Markdown table

The result goes to a new tab, a file or the clipboard (a workbook can only go to a file). A preview shows the first rows. Saving never writes over the workbook or file you opened: a table tab with changes asks where to export instead, and closing it asks first, like any unsaved tab.

The Export dialog with XML chosen: Root rows, Row row, Leave out empty values ticked, and a preview where each order line is a row element holding an orders element with id, placed, status and a nested clinic and address

Writing HL7 messages

An HL7 export fills a template once for each row. The template is the message as it should be written, one segment per line, with {Column} wherever a column's value goes:

MSH|^~\&|ETTIN|NORTHLAB|||{Sent}||ADT^A08|MSG{#}|P|2.5.1
PID|||{MRN}^^^NORTHLAB^MR||{Family}^{Given}||{Born}|{Sex}
  • Values are escaped for HL7, so a | or ^ in a name can't break the message.
  • {#} is the row number, handy for message control ids.
  • {{ and }} write a brace.
  • A column the template names that the table doesn't have is an error, shown in the preview.

When the columns already have HL7 names, like the ones read from an HL7 file, the template is made for you from them, so changing a few values and exporting writes the messages back. Otherwise it starts as a short MSH and PID skeleton to fill in. Segments are separated by a carriage return, as HL7 expects.

Saving the steps as a recipe

Save as Recipe… saves how the data is read, every step and the export as a recipe with one Table step. Run it on the next file from the Recipes window, or from the command line, where --out writes the result to a file (needed for an Excel workbook):

ettin-edit --recipe "Ward report" export.csv > report.json
ettin-edit --recipe "Ward report" export.xlsx --out report.xlsx

A recipe made from a workbook reads workbooks, and one made from CSV reads CSV: the Source step is part of the recipe.

To change a saved table recipe, open some data as a table, make the steps again, and save under the same name: the recipe's steps are replaced.

Open tables and their steps are kept with the session, so they are still there after a restart.

JSON and JavaScript

What the JSTool plugin does for Notepad++ is built in. The commands that change the text (Format, Minify, Sort JSON Keys) are in Transform > JSON and XML; Validate JSON and the JSON Tree, which only look at it, are in Tools. In a JSON file they are also in the right-click menu.

Like every text tool, these work on the selection, or on each selection when there are several, or on the whole document when nothing is selected. Each use is one undo step. When a tool finds a mistake, a notice at the bottom of the window gives the line and column, the caret moves there, and Go to takes you back to it later.

Format and minify

CommandShortcutWhat it does
FormatCtrl+Alt+MIndents JSON or JavaScript neatly, one item per line
MinifyCtrl+Alt+NRemoves all the spaces and line breaks that aren't needed

Formatting indents with a tab or with spaces, as set for the editor in Preferences.

Both commands try strict JSON first. If the text isn't JSON (it has comments, single quotes, trailing commas or code), they treat it as JavaScript and say so in the notice. The JavaScript formatter understands modern syntax: template strings, regular expression literals, arrow functions, classes, switch and case, and comments, which it keeps.

Checking and sorting

  • Validate JSON checks that the text is valid JSON and points at the first mistake if it isn't.
  • Sort JSON Keys puts the keys of every object in alphabetical order, all the way down, and formats the result.

The JSON tree

JSON Tree (Ctrl+Alt+J) opens a panel on the right showing the current document as a tree of objects, arrays and values.

  • The tree updates as you type and opens at the caret's position.
  • Click a node to jump to it in the text.
  • Type in Filter keys and values to show only the nodes whose key or value contains some text, with their parents.
  • The ⊞ and ⊟ buttons at the top expand and collapse everything; right-click a node for Expand All Inside.
  • Right-click a node to Copy Path (a path such as $.items[2].name), Copy Key or Copy Value.

If the document isn't valid JSON, the panel says where the problem is, with a Go to Error button. Very large documents are too big to show as a tree; the panel says so rather than freezing.

XML Tools

What the XML Tools plugin does for Notepad++ is built in. The commands that change the text (Format XML, Linearize, Escape and Unescape) are in Transform > JSON and XML; the checks, validation, XSL Transform and the XPath panel, which leave the text alone, are in Tools. Like the other text tools, the formatting commands work on the selection or on the whole document, as one undo step.

Formatting

CommandShortcutWhat it does
Format XMLCtrl+Alt+Shift+BIndents the XML, one element per line
Format XML, Attributes on New LinesThe same, with each attribute on a line of its own
LinearizeCtrl+Alt+Shift+LRemoves the indentation and line breaks between elements

Text inside elements, comments, CDATA sections and processing instructions is kept as it is.

Checking XML

  • Check XML Syntax (Ctrl+Alt+Shift+M) checks that the document is well-formed: every tag closed, attributes quoted, one root element. A mistake is shown with its line and column, and the caret moves there.
  • Check Syntax When Saving runs that check each time you save an XML file, and warns you (the file is still saved). Also in Preferences under Files and Startup.

Validating against a schema

Validate XML checks the document against an XSD schema or a DTD:

  • the XSD named in the root element's xsi:schemaLocation or xsi:noNamespaceSchemaLocation, or
  • the DTD in the document's <!DOCTYPE>, or
  • the schema you last used for that file.

If there isn't one, or to use another, choose Validate XML Against… and pick the .xsd or .dtd file. Ettin Edit remembers your choice for that file.

Problems are listed in the results panel; click one to jump to its line. A valid document gets a short notice saying so.

Not supported: xs:key, xs:keyref and xs:unique, xs:redefine, and schemas that have to be downloaded from the internet (keep a copy next to your file instead).

XSL Transform

XSL Transform… asks for an XSLT 1.0 stylesheet and runs it over the document. The output opens in a new tab, coloured as HTML or XML when that's what it is. Messages from xsl:message are shown in a notice.

Not supported: xsl:import, xsl:include and the document() function.

XPath

XPath Panel (Ctrl+Alt+Shift+E) opens a panel below the text. Type an XPath 1.0 expression and press Enter or Evaluate:

  • If the result is a set of nodes, each is listed; click one to jump to it in the text. Copy Results copies them all.
  • Otherwise the panel shows the value, such as a number from count(//item) or the text from string(//title).
  • Recent brings back earlier expressions.

Every XPath 1.0 function is available, plus ends-with(), lower-case() and upper-case() from XPath 2.0. Namespace prefixes declared in the document work in expressions, and a name without a prefix also matches elements in the default namespace, so //book finds <book> even in an XHTML or Atom file.

The current XPath

In an XML file the status bar shows where the caret is, such as /catalog/book[3]/title. Click it, or use Copy Current XPath (Ctrl+Alt+Shift+P), to copy it.

Escaping

  • Escape Special Characters turns <, >, &, " and ' into &lt;, &gt;, &amp;, &quot; and &apos;.
  • Unescape Special Characters turns them back.

Closing tags

Close Tags Automatically adds the closing tag as you type an opening one in XML and HTML. Empty HTML elements such as <br> and <img> don't get one.

MIME Tools

Transform > Encode and Hash encodes and decodes text the way the MIME Tools plugin does for Notepad++ (on a selection, it is also in the right-click menu as Encode / Decode). Each command works on the selection (each selection, if there are several) or on the whole document, and is one undo step. Select just the part you need, such as one value in a JSON file, so the rest is left alone.

Base64

CommandWhat it does
Base64 EncodeEncodes the text (as UTF-8) on one line
Base64 Encode with Line BreaksThe same, with a line break every 76 characters, as in email
Base64 Encode, URL-SafeUses - and _ instead of + and /, without = padding, for URLs and file names
Base64 DecodeDecodes either kind, with or without padding and line breaks

Decoding stops with a message if the result isn't text, for example if the Base64 holds an image.

URLs

CommandWhat it doesa b/c?d=é becomes
URL Encode (Part of a URL)Encodes everything except letters, digits and -_.~, for one value in a query string or patha%20b%2Fc%3Fd%3D%C3%A9
URL Encode (Whole URL)Keeps /, ?, =, &, : and the other characters that give a URL its structurea%20b/c?d=%C3%A9
URL DecodeTurns %XX back into characters

Quoted-printable

Quoted-Printable Encode and Decode handle the encoding used in email bodies, where =C3=A9 stands for é and a line ending in = continues on the next.

HTML

  • HTML Encode turns &, <, >, " and ' into entities.
  • HTML Encode, Including Accents and Symbols also encodes every non-ASCII character, by name where it has one (&eacute;, &euro;) and by number otherwise.
  • HTML Decode turns named and numbered entities back into characters.

SAML

SAML Decode turns a SAML request or response back into readable XML. Select the Base64 text of a POST, the value of a SAMLRequest or SAMLResponse parameter, or a whole redirect URL that contains one. Ettin Edit URL-decodes it if needed, decodes the Base64, inflates it if it was compressed, and pretty prints the XML.

Compare

Tools > Compare shows the differences between two versions of a text, side by side. It's Ettin Edit's take on the ComparePlus plugin.

Starting a comparison

Command (Tools > Compare)Compares the current tab with…
Compare with Previous Tab (Ctrl+Alt+D)the tab you were in before it. When the window is split, this is Compare the Two Views and compares the two tabs you can see.
Compare Withany other open tab you pick
Compare to Last Savethe file as it is on disk, showing your unsaved changes
Compare to Clipboardthe text on the clipboard
Compare to Last Commit (Git)the file as it was in the last Git commit. Needs git installed and the file in a Git repository.
Compare Selectionstwo pieces of text: select one, then Ctrl+drag to select the other, or select one in each view

The most used ones are also on the toolbar's Tools tab. (Until 2.1 they were in the editor's right-click menu too; that menu now offers the commands that change the text you clicked.)

The Compare tab

The comparison opens in a tab of its own, with the two texts side by side and their lines lined up:

  • Added lines, removed lines and changed lines each have their own colour, and the words that changed inside a changed line are highlighted.
  • Moved blocks, lines that were cut from one place and pasted in another, are coloured apart from additions and removals.
  • Blank filler rows keep the two sides level, and both sides scroll together.
  • The bar at the right edge shows where all the differences are in the file; click or drag in it to go there.

The Compare tab is read-only, but it follows the tabs being compared: edit one of them and the comparison updates. Double-click a line to jump to it in its own tab and edit it there.

The toolbar

  • First, ↑, ↓ and Last move between differences; F7 and Shift+F7 do the same from anywhere.
  • Difference 3 of 12 and a count of changed, added and removed lines, or Identical when there's nothing to show.
  • Swap Sides puts the left text on the right.
  • Export Patch opens the differences as a unified diff (the format git diff and patch use) in a new tab.
  • Options:
    • Ignore Spaces and Tabs: differences in spacing don't count.
    • Ignore Case: Hello and hello are the same.
    • Ignore Empty Lines: added or removed blank lines don't count.
    • Detect Moved Lines: on by default.
  • × closes the comparison (also Tools > Compare > Close Comparison).

Tools > Compare > Show Comparison brings the Compare tab back to the front.

Very large or very different files stay responsive: the comparison has a time limit and only draws the rows on screen.

CsvQuery

CsvQuery runs SQL queries on the CSV file you have open, like the CsvQuery plugin for Notepad++. Open a .csv, .tsv or other delimited file and choose Tools > CsvQuery > CsvQuery Panel (Ctrl+Alt+Q). A panel opens below the text, and runs SELECT * FROM this straight away.

Ottar says: your spreadsheet would like a word. It can wait.

Tables

  • The current tab is always the table this.
  • Every other open tab is a table named after its file, with anything that isn't a letter or digit turned into _: orders 2024.csv is orders_2024. A tab is only read when a query names it.
  • The Tables menu in the panel inserts a table's name into the query.

So you can join files:

SELECT c.name, SUM(o.total) AS spent
FROM this AS o
JOIN customers AS c ON c.id = o.customer_id
GROUP BY c.name
ORDER BY spent DESC

Writing and running queries

Type SQL in the box at the top of the panel and press Ctrl+Enter, click Run, or use Tools > CsvQuery > Run Query. Queries use SQLite's SQL, so WHERE, GROUP BY, ORDER BY, LIMIT, joins, sub-queries, window functions and SQLite's functions all work.

Queries run in the background, so a big file never freezes the editor. The query runs again by itself when you edit the tab or switch to another one. Recent brings back earlier queries.

UPDATE, DELETE, INSERT and CREATE TABLE work too, on a copy of the data held for the query; the file itself never changes. To keep the result, put it in a new tab (below).

How the file is read

Ettin Edit works out how the file is laid out, and the bar above the query box lets you correct it:

  • Delimiter: comma, semicolon, tab, pipe or space.
  • Quote character: ", ' or none.
  • Header row: whether the first row names the columns. Without one, the columns are called col1, col2 and so on.
  • Reset goes back to what was detected.

Each column is stored as integers, decimals or text, whichever is the narrowest that fits every value. Values with leading zeros, such as zip codes or ids like 007, stay text so the zeros aren't lost. Empty fields are NULL. In semicolon-separated files, decimal commas such as 3,50 count as numbers.

Results

The Results view shows the first 100,000 rows, with how long the query took.

  • Click a column heading to sort by it; click again to reverse.
  • Right-click a cell to Copy Value or Copy Row.
  • Copy (or Tools > CsvQuery > Copy Results) copies every row as tab-separated text, which pastes cleanly into a spreadsheet.
  • Open in New Tab (Results to New Tab) writes all the result rows to a new tab as CSV.

Columns

The Columns view describes each column of this: its type, how many values are filled, empty and distinct, and the minimum, maximum and average. Change a column's Type there if Ettin Edit picked the wrong one, for example to sort a column of numbers stored as text.

Preferences and settings

Settings > Preferences… (Ctrl+,) holds every setting in one window. The sections are on the left: Appearance, Editing, Languages, Transform, Files and Startup and Plugins. Below them are buttons for the Shortcut Mapper, Theme Colours and Customise Toolbar. Those open in front of Preferences.

Changes apply as you make them

There's no OK or Apply button. Each change takes effect and is saved straight away, and closing the window keeps it. The buttons at the bottom are for going back:

  • Undo Changes puts every setting back as it was when you opened the window.
  • Reset Section puts the settings of the section you're looking at back to Ettin Edit's defaults.

Preferences, the Shortcut Mapper, the Recipes window, the Transform dialogs and the other larger windows can be resized: drag a corner or an edge. The rows of settings wrap when the window is narrow.

Theme Colours, Customise Toolbar, the Shortcut Mapper and the Recipes window work the same way: changes are saved as you make them, and Undo Changes puts things back as they were when the window opened.

Type in Search settings at the top to see only the settings whose name (or a word related to it) matches, from every section at once. Searching tab shows the tab width, what the Tab key types and the per-language settings; wrap finds Word wrap. Settings that also live in a menu, like word wrap, whitespace symbols, the menu bar and the toolbar, are all here so search can find them. Clear the box to go back to the sections.

Appearance

Theme

  • Theme: the colours of the editor and the window. See Themes.
  • Follow the system's light/dark setting: when on, Ettin Edit uses the light theme of the Light / dark pair while your desktop is in light mode and the dark one while it's in dark mode, and switches when the desktop does. Picking a theme from the Theme list changes the half of the pair that's showing. On Linux the desktop's choice is read from the desktop portal (GNOME, KDE and most others) or from GNOME's settings.

Interface

  • Interface size: makes menus, dialogs, the toolbar and the editor bigger or smaller together, from 80 % to 200 %. The editor's own text size is under Font.
  • Interface language: the language of menus, dialogs and messages: the same as your system's, or one you choose. Open Translations Folder and Reload are for adding your own translations. See Translations.
  • Toolbar: the full ribbon, the simplified one, or hidden. See The toolbar.
  • Menu bar: show or hide the menu bar (Ctrl+M).

Font

  • Editor font: the font for the text. The list shows the fonts installed on your computer, monospaced ones first; tick Show proportional fonts to see the rest, and type in Find to look for one. Use Built-in goes back to Hack, the font Ettin Edit comes with.
  • Size: the text size. Ctrl+0 returns to this size after zooming.

Whatever font you choose, characters it doesn't have (Chinese, Japanese, Korean, Bangla, Hindi, Thai and other scripts) are drawn with a font from your system that has them. See Text in other scripts.

Markdown Preview

  • Load images from the web: on by default. Untick it and the Markdown Preview only shows images from files, so opening a Markdown file never reaches the network.

Editing

Show: word wrap, line numbers, the current line highlight, whitespace, end-of-line symbols and invisible characters, indent guides, and the Long-line marker at column, with its column. These are the same switches as in the View menu.

Typing

  • Close brackets and quotes automatically (Settings > Auto-Close Brackets and Quotes)
  • Close HTML and XML tags automatically (Tools > Close Tags Automatically)
  • Smart indentation: keep the indent on Enter, and indent after an opening bracket. Also Settings > Smart Indentation.
  • Suggest words from the document while typing (Settings > Word Completion)
  • Suggest the language's keywords and functions (Settings > Keyword and Function Completion)
  • Show a function's parameters while typing a call (Settings > Parameter Hints)

See Typing helpers for what each one does.

Languages

Indentation

  • Tab width: how many columns a tab takes up, and how many spaces an indent is when indenting with spaces.
  • Tab key types tabs or spaces: what Tab and automatic indentation insert. View > Indent With Spaces changes it for the current tab only.
  • Detect indentation when a file opens: on by default. Ettin Edit looks at the first 1000 indented lines of a file and, when they're clearly indented with tabs or with a number of spaces, uses the same for that file. A Python file indented with 4 spaces gets 4 spaces even if your setting says tabs.

Per-language settings

A tab width and tabs-or-spaces for one language, which win over the settings above. Out of the box JSON and YAML use 2 spaces, and Makefiles and Go use tabs. Pick a language… and Add adds a row; Default in a row means "use the general setting"; × removes the row.

The order, from weakest to strongest: the general setting, the language's setting, what the file itself uses (when detection is on), and View > Indent With Spaces for that tab.

In settings.json these are kept as language_overrides, for example {"json": {"tab_width": 2, "use_tabs": false}, "makefile": {"use_tabs": true}}.

Transform

  • Hash with no selection: what a hash does when nothing is selected and it hashes the whole document: Copy the hash to the clipboard (the default) or Open the hash in a new tab.
  • Recipe command steps: Ask before running (the default) or Run without asking. See Recipes.
  • Shell for commands: the program, with its options, that runs Filter Through Command and recipe command steps, like bash -c, zsh -c or pwsh -Command. Put a path with spaces in quotes. Leave it empty to use the system's shell (sh -c on Linux, cmd /C on Windows).
  • JSON / XML indent: the indent Format JSON and Format XML use: the same as the document, 2 spaces, 4 spaces or a tab.

Files and Startup

Startup and exit

  • Reopen the files that were open last time: start where you left off.
  • Quit without asking about unsaved changes, and bring them back next time: see You won't lose your work. Also Settings > Remember Unsaved Changes on Exit.
  • Open files in the running Ettin Edit window: one window for everything. Also Settings > Single Window.

Files

  • Reload files changed on disk automatically when they have no unsaved changes. Also Settings > Reload Files Changed on Disk Automatically.
  • Check that XML is well-formed each time it's saved. Also Tools > Check Syntax When Saving.

New Documents: what a new tab (Ctrl+N) starts with:

  • Line ending: your system's usual one (LF on Linux, CR LF on Windows), or one you choose.
  • Encoding: UTF-8 unless you choose another.
  • Language: Plain Text, or the language you write most, so new tabs are coloured and complete as that language straight away.

Opened files always keep their own line ending and encoding.

Suggestions

  • Suggest transforms for files I open or paste: the bar that offers Format for one-line JSON, Decode for a token and so on. On by default. See Suggestions.
  • Show the dismissed suggestions again: shown when you have turned some kinds off with Don't suggest this again.

Printing

  • Print line numbers
  • Print syntax colours (darkened to read well on paper)

Updates

  • Check for a new version of Ettin Edit once a week. Also Help > Check for Updates Automatically.

Settings files: Export Settings…, Import Settings… and Open Settings Folder. See Moving your settings to another computer.

Plugins

Programs that run plugins: the Python 3 and Node.js programs to run plugins with. Leave them empty and Ettin Edit finds them on the PATH; fill them in if you want a particular Python (a virtual environment, say) or a Node.js that isn't on the PATH. Changes apply when plugins are reloaded (Plugins > Reload Plugins).

Where settings are kept

Settings are saved in settings.json in the settings folder (Settings > Open Settings Folder). Your keyboard shortcuts are in it too; the toolbar is in toolbar.json, and themes, recipes, languages and translations each have their own folder.

You can edit any of these files while Ettin Edit is running. When you save one, Ettin Edit picks up the change within a second: a theme recolours the editor, a recipe appears in the Recipes window, a language or translation is reloaded, and changes to settings.json take effect. If the file has a mistake, Ettin Edit keeps using the last version that worked and shows a message with the file, the line and column, and an Open button that opens the file at that line. (Plugins aren't watched this way; turn on Reload when its files change for a plugin you're writing. See Plugins.)

Moving your settings to another computer

Settings > Export Settings… saves one .ettin-settings.zip file with your settings (shortcuts included), your toolbar, and your themes, recipes and languages. Plugins aren't copied; the file lists which ones you had and their versions.

Settings > Import Settings… on the other computer opens such a file and shows what's in it before anything changes: how many settings files, themes, recipes and languages, which files you have now that it would replace, and any plugins it was used with that aren't installed. Choose Import to go ahead. Each file it replaces is first copied to a new folder under backups in the settings folder, named after the date and time, so you can get it back.

The toolbar

Under the menu bar is a tabbed toolbar, like the ribbon in Microsoft Office. Each tab holds groups of buttons for commands you use often. You can put any menu command on it, plugin commands and saved macros too, and arrange the tabs, groups and buttons however you like.

The toolbar's Home tab: File, Transform (Keep Matching, Filter Command, Format, Convert to), Recipes, Find and Quick groups

Using it

  • Click a tab name (Home, Edit, Transform, View, Tools) to show its buttons.
  • Hover over a button to see where its command is in the menus and its shortcut.
  • A button with a ▾ under or beside its label, such as Format or Convert to, opens a menu.
  • ? at the right of the tab names opens the Help menu: User Manual, User Manual on the Web, Check for Updates and About.
  • Buttons for commands that turn something on or off, such as Word Wrap, are outlined while it's on. Buttons for commands that can't run right now, such as Undo with nothing to undo, are greyed out.
  • When the window is too narrow for a tab, its groups shrink to fit (see below), so every button stays one click away.

When the window is narrow

The toolbar never scrolls and never cuts a label off. When a tab's groups don't fit, they shrink one step at a time, starting with the group on the right:

  1. Small: large buttons become small ones, three to a column.
  2. Icons only: small buttons lose their labels. Hover over one to see its name and shortcut. A group whose buttons share one icon skips this step.
  3. Collapsed: the whole group becomes one button with the group's name and a ▾. Click it for a menu of the group's commands, with the same ticks and greyed-out entries the buttons would show.

When every group is as small as it gets and the tab still doesn't fit, the groups on the right move behind a » button at the end of the toolbar. Its menu lists them, each with its commands. Widen the window and the groups come back, largest first.

The Transform tab in a narrow window: Lines, Identifier Case, Convert and Encode are collapsed into dropdown buttons

This works for a toolbar you've customised too. Some labels are shorter on the toolbar than in the menus: Transform > Filter Through Command… is Filter Command.

On first launch Ettin Edit opens at 80 % of your screen (at most 1400×900, at least 1100×720), so the default tabs fit without shrinking on most screens. After that it remembers the size you leave it at. If you quit with the window maximized, it opens maximized again; un-maximizing it then gives the first-launch size.

The default tabs

TabGroups
HomeFile (New, Open, Save); Transform (Keep Matching, Filter Command, Format ▾, Convert to ▾); Recipes (Recipes ▾, Record Recipe, Run Last Recipe); Find (Find, Replace, Command Palette); Quick (Case ▾, Sort Lines, Remove Duplicates)
EditClipboard, Undo, Search, Tabs, Lines, Sort, Case, Comment, Blanks, Selection
TransformRecipes, Command, Lines, Identifier Case, Convert (To JSON, To YAML, To TOML, To XML, To CSV, To Markdown table), Encode
ViewShow, Zoom, Folding, Panels, Window, Customise
ToolsCompare, JSON, XML, Data (CsvQuery and MIME Tools), Macros

Home puts transforms first. Its drop-down buttons open the same menus as Transform: Format has Format, Minify and Sort Keys for JSON and Format, Linearize, Escape and Unescape for XML; Convert to is Transform > Convert to; Recipes lists your recipes with Manage Recipes and Record Recipe; Case is Transform > Convert Case To. Customise Toolbar lists these menus under Drop-down menus, so you can put them on any tab.

Until 2.1, Home also had Clipboard, Undo, Find in Files, Tabs and Help groups. The first four are at the start of the Edit tab now, and Help is the ? button. If you never changed your Home tab, it is updated to the new one the first time 2.1 starts. If you did change it, it is left as you made it.

Simplified toolbar

The simplified toolbar: one row of small buttons on the Home tab

☰ Simplified at the right of the tab names (or View > Toolbar > Simplified Toolbar) turns the toolbar into one row of small buttons, which leaves more room for the text. It uses the same tabs and buttons: large buttons keep their labels and small ones show just their icon. Click ☰ Full to go back. Ettin Edit remembers which one you use.

When the row doesn't fit, it shrinks the same way as the full toolbar, starting on the right: buttons lose their labels, then a group becomes one drop-down with its name and a ▾, and when that isn't enough, the groups on the right go behind ».

Collapsing and hiding

To give the text more room, collapse the toolbar so only its tab names show:

  • click ⌃ at the right end of the tab names, or
  • double-click a tab name, or
  • press Ctrl+F1, or
  • choose View > Toolbar > Collapse Toolbar.

While it's collapsed, clicking a tab name opens its buttons over the text; they close again when you click a button or anywhere else. Expand it the same ways (⌄ at the right end).

View > Toolbar > Toolbar hides the toolbar completely and shows it again; so does Hide the toolbar in its right-click menu.

You can hide the classic menu bar as well, with View > Menu Bar, Ctrl+M or Hide the menu bar in the toolbar's right-click menu. While it's hidden, tap Alt to show it for a moment, and press Ctrl+M to bring it back for good. The Help menu's commands (the user manual, Check for Updates and About) are under the toolbar's ? button too. With both hidden, only the tabs, the text and the status bar are left. Both choices are kept in settings.json.

Customising

Open Settings > Customise Toolbar…, or right-click the toolbar and choose Customise Toolbar… (it's also in View > Toolbar and in Preferences).

The Customise Toolbar dialog: commands on the left, the toolbar's tabs, groups and buttons on the right

On the left is every command you can add: everything in the menus (themes, languages and encodings included), the commands of plugins that are running, and your saved macros. Type in the filter box to narrow the list; it matches every word you type, anywhere in the command's menu path.

On the right is the toolbar: tabs, the groups in each tab, and the buttons in each group.

Adding a button

  • Drag a command from the left onto the right. Dropped on a button, it goes in front of that button; dropped on a group or a tab, it goes at the end of it.
  • Or pick a command on the left, select where it should go on the right, and click Add › (or double-click the command). It goes after the selected button, or at the end of the selected group.

Arranging

  • Drag tabs, groups and buttons to move them. A button can move to another group or tab, and a group to another tab.
  • ▲ and ▼ move the selected item one place. A button at the end of its group moves into the next group.
  • ‹ Remove takes the selected button, group or tab off the toolbar. You can also right-click a button on the toolbar and choose Remove from Toolbar.
  • New Tab and New Group add an empty one after the selection.
  • Untick the box in front of a tab to hide it without losing its buttons.

Changing a button, group or tab

Select it on the right and change it at the bottom of the dialog:

SelectedWhat you can change
A tab or groupIts name. The built-in names follow the interface language until you rename them.
A buttonLabel (leave it empty for the command's own name), Size and Icon

Large buttons have the icon above the label. Small buttons have the icon beside the label, and three of them stack in a column.

Change… opens the icon picker. It has the 1,500 icons of the Phosphor set (MIT licence); type part of a name, like star or arrow, to find one. Use the command's icon goes back to the default.

Changes show on the toolbar and are saved as you make them; Close keeps them. Undo Changes puts the toolbar back as it was when you opened the window, and Reset to Defaults puts back the toolbar Ettin Edit came with.

Plugin commands

Plugin commands appear under Plugins › plugin name in the command list once the plugin is running. A plugin can give its commands an icon; the others get a puzzle piece. While a plugin isn't running (turned off, or still starting), its buttons are left off the toolbar, and they come back when it runs again. In the Customise dialog they show greyed out.

To give your own plugin's commands an icon, see Writing plugins.

Where the layout is kept

Your toolbar is saved in toolbar.json in the settings folder (~/.config/EttinEdit on Linux, %APPDATA%\EttinEdit on Windows). Copy that file to use the same toolbar on another computer. While you haven't changed anything, there's no file and you get the default toolbar, including any new buttons later versions add. A toolbar you have customised keeps your changes; Ettin Edit 1.7 adds only the new Help group to the end of its Home tab (unless you renamed or removed that tab), so the Help commands can be reached while the menu bar is hidden. Delete the group if you don't want it. Ettin Edit 1.9.5 likewise adds the Transform tab after your Edit tab (unless you removed that tab); hide or delete it if you don't want it. Ettin Edit 2.0 adds the Recipes group to the start of your Transform tab. Ettin Edit 2.0.2 turns old "JSON to YAML" style buttons into To YAML style Convert to buttons (keeping your labels and icons), and moves recipe buttons from the recipe's name to its id. Whether the toolbar is shown or collapsed is kept in settings.json.

Keyboard shortcuts

Every command in Ettin Edit can have a keyboard shortcut, and you can change any of them. This page lists the defaults; the menus and the command palette always show the ones in use.

Changing shortcuts

Settings > Shortcut Mapper… lists every command, every saved macro and every plugin command, with their shortcuts.

  1. Type in Find to narrow the list, by the command's name or by a shortcut such as ctrl+d. Tick Only commands with a shortcut to hide the rest.
  2. Select a command.
  3. Click Set… (or Change…), then press the new keys. Esc cancels.
  4. If another command already uses those keys, Ettin Edit tells you which one. Move It Here takes the shortcut from the other command; Cancel leaves things as they were.

A command can have more than one shortcut: Add Another… adds one, Remove removes the selected one, and Reset to Default puts the command's original shortcut back. Reset All Shortcuts resets every command.

Every change is saved as you make it. Undo Changes at the bottom puts the keymap and every shortcut back as they were when you opened the window.

Two-key chords

A chord is two keys pressed one after the other, like VS Code's Ctrl+K S: press Ctrl+K, let go, then press S. After the first key a note at the bottom of the window says Ettin Edit is waiting for the second; Esc cancels. The second key can be a plain letter or have Ctrl or Alt too.

To give a command a chord, select it and click Add Chord…, then press the first key and the second. A key that starts a chord can't also be a shortcut on its own, and Ettin Edit says so if you try. Remove removes the selected command's shortcuts and chords. In settings.json a chord is written with a space between the keys: "Ctrl+K S".

Both keymaps come with these chords, so they work whichever you pick:

ChordCommand
Ctrl+K SSave All
Ctrl+K WClose All
Ctrl+K ROpen Containing Folder
Ctrl+K ZDistraction-free mode
Ctrl+K VMarkdown Preview
Ctrl+K Ctrl+SShortcut Mapper
Ctrl+K Ctrl+OOpen Folder as Workspace
Ctrl+K Ctrl+0Fold All
Ctrl+K Ctrl+JUnfold All
Ctrl+K Ctrl+[ / Ctrl+]Fold / Unfold Current Level

Ctrl+K on its own has no command in either keymap, so nothing is lost.

Right-click a command and choose Copy Command ID to copy the id a plugin uses to run it.

Rules for shortcuts:

  • They need Ctrl or Alt, unless they use a function key (F1 to F12), so plain typing is never taken over.
  • Ctrl+C, Ctrl+X and Ctrl+V are kept for copy, cut and paste.
  • Undo, redo, cut, copy, paste, select all and completion are handled by the editor itself and can't be changed.

Your shortcuts are saved in settings.json in the settings folder, so they move with your settings.

Keymaps

Keymap at the top of the Shortcut Mapper (also in Preferences) picks the set of shortcuts you start from:

  • Ettin (Notepad++ style): the default, listed under Default shortcuts below. If you know Notepad++, these are the keys you expect.
  • VS Code style: the keys below change to the ones VS Code uses; every other command keeps its Ettin key.

Shortcuts you set yourself stay on top of whichever keymap you pick, so switching doesn't lose them.

CommandEttinVS Code style
Save As…Ctrl+Alt+SCtrl+Shift+S
Save AllCtrl+Shift+SCtrl+Alt+S
Command Palette…F1Ctrl+Shift+P, F1
Play MacroCtrl+Shift+Pnone
Tab List…noneCtrl+P
Print…Ctrl+Pnone
Delete LineCtrl+Shift+LCtrl+Shift+K
Select All OccurrencesAlt+F3Ctrl+Shift+L
Select Next OccurrenceCtrl+Shift+DCtrl+D
DuplicateCtrl+DAlt+Shift+Down
Move Lines Up / DownCtrl+Shift+Up / Ctrl+Shift+DownAlt+Up / Alt+Down
Toggle Line CommentCtrl+QCtrl+/
Toggle Block CommentCtrl+Shift+QAlt+Shift+A
Insert Blank Line Below / AboveCtrl+Alt+Shift+Enter / Ctrl+Alt+EnterCtrl+Enter / Ctrl+Shift+Enter
Fold / Unfold Current LevelCtrl+Alt+F / Ctrl+Alt+Shift+FCtrl+Shift+[ / Ctrl+Shift+]
Markdown PreviewCtrl+Shift+MCtrl+Shift+V
Folder PanelnoneCtrl+B

VS Code style also keeps Ctrl+Alt+S for Save All, next to the Ctrl+K S chord both keymaps have (Two-key chords).

Default shortcuts

On macOS-style keyboards, Ctrl is still Ctrl; Ettin Edit runs on Linux and Windows only.

File

CommandShortcut
NewCtrl+N
Open…Ctrl+O
SaveCtrl+S
Save As…Ctrl+Alt+S
Save AllCtrl+Shift+S
Print…Ctrl+P
CloseCtrl+W
Close AllCtrl+Shift+W

Edit

CommandShortcut
UndoCtrl+Z
RedoCtrl+Y
CutCtrl+X
CopyCtrl+C
PasteCtrl+V
Select AllCtrl+A
Line Operations > DuplicateCtrl+D
Line Operations > Delete LinesCtrl+Shift+L
Line Operations > Move UpCtrl+Shift+Up
Line Operations > Move DownCtrl+Shift+Down
Line Operations > Join LinesCtrl+J
Line Operations > Split Lines at Long-Line ColumnCtrl+I
Line Operations > Insert Blank Line AboveCtrl+Alt+Enter
Line Operations > Insert Blank Line BelowCtrl+Alt+Shift+Enter
Comment > Toggle Line CommentCtrl+Q
Comment > Toggle Block CommentCtrl+Shift+Q
Insert > Date and Time (Short)F5
Insert > Date and Time (Long)Shift+F5
Multi-Select > Select Next OccurrenceCtrl+Shift+D
Multi-Select > Select All OccurrencesAlt+F3
Auto-Completion > Complete WordCtrl+Space
Auto-Completion > Show Parameter HintCtrl+Shift+Space
Column Editor…Alt+C
Column ModeAlt+Shift+C

Search

CommandShortcut
Find…Ctrl+F
Replace…Ctrl+H
Find NextF3
Find PreviousShift+F3
Find Selected NextCtrl+F3
Find Selected PreviousCtrl+Shift+F3
Find in Files…Ctrl+Shift+F
Go to Line…Ctrl+G
Bookmark > Toggle BookmarkCtrl+F2
Bookmark > Next BookmarkF2
Bookmark > Previous BookmarkShift+F2

View

CommandShortcut
Word WrapAlt+Z
Distraction-Free ModeF11
Command Palette…F1
Collapse ToolbarCtrl+F1
Menu Bar (show or hide)Ctrl+M
Next TabCtrl+Tab or Ctrl+PageDown
Previous TabCtrl+Shift+Tab or Ctrl+PageUp
Focus Other ViewF8
Hex ViewCtrl+Alt+Shift+H
Markdown PreviewCtrl+Shift+M
Folding > Fold AllAlt+0
Folding > Unfold AllAlt+Shift+0
Folding > Fold Current LevelCtrl+Alt+F
Folding > Unfold Current LevelCtrl+Alt+Shift+F
Folding > Fold Level 1 … 5Alt+1, Alt+2, Alt+3, Alt+4, Alt+5
Zoom InCtrl++ or Ctrl+=
Zoom OutCtrl+-
Reset ZoomCtrl+0

Transform

CommandShortcut
Recipes > Manage Recipes…Ctrl+Alt+R
Filter Through Command…Ctrl+Alt+P
Lines > Keep Matching Lines…Ctrl+Alt+K
Table > Show as Table / Show as TextCtrl+Alt+T
Macros > Start or Stop RecordingCtrl+Shift+R
Macros > PlaybackCtrl+Shift+P
Convert Case To > UPPERCASECtrl+Shift+U
Convert Case To > lowercaseCtrl+U
Convert Case To > Title CaseAlt+U
Convert Case To > Sentence caseCtrl+Alt+U
Convert Case To > iNVERT cASECtrl+Alt+Shift+U
JSON and XML > Format JSONCtrl+Alt+M
JSON and XML > Minify JSONCtrl+Alt+N
JSON and XML > Format XMLCtrl+Alt+Shift+B
JSON and XML > LinearizeCtrl+Alt+Shift+L

Settings

CommandShortcut
Preferences…Ctrl+,

Tools

CommandShortcut
Compare > Compare with Previous Tab / the Two ViewsCtrl+Alt+D
Compare > Next DifferenceF7
Compare > Previous DifferenceShift+F7
CsvQuery > CsvQuery PanelCtrl+Alt+Q
CsvQuery > Run Query (in the panel)Ctrl+Enter
JSON TreeCtrl+Alt+J
Check XML SyntaxCtrl+Alt+Shift+M
XPath PanelCtrl+Alt+Shift+E
Copy Current XPathCtrl+Alt+Shift+P

Help

CommandShortcut
User ManualShift+F1

In the editor

These aren't commands, so they're not in the Shortcut Mapper:

KeysWhat they do
Ctrl+click, Alt+clickAdd a caret
Ctrl+dragAdd a selection
Alt+drag, Alt+Shift+arrowsColumn selection (a plain drag and Shift+arrows in Column Mode)
Ctrl+Alt+Up, Ctrl+Alt+DownAdd a caret above or below
EscBack to one caret; close the completion list, a parameter hint or the find bar
HomeFirst non-blank character, then the start of the line
Ctrl+Left, Ctrl+RightMove by words
Ctrl+Backspace, Ctrl+DeleteDelete by words
Tab, Shift+TabIndent or outdent the selected lines
Middle-click on a tabClose it

Themes and colours

A theme colours both the text and the whole window: menus, tabs, panels and the status bar. Ettin Edit comes with nine:

DarkLight
Ettin Dark (the default, based on Base16 Eighties)Ettin Light
Ettin NightOcean Light
Ocean DarkSolarized Light
MochaGitHub Light
Solarized Dark

Pick one from View > Theme, where they're listed under Dark and Light. The change is immediate and remembered.

To have Ettin Edit switch between a light and a dark theme with your desktop, turn on Follow the system's light/dark setting in Preferences > Appearance and pick the pair.

Themes are files

Every theme, built-in ones included, is a TextMate .tmTheme file in the themes folder:

  • Linux: ~/.config/EttinEdit/themes/
  • Windows: %APPDATA%\EttinEdit\themes\

View > Theme > Open Themes Folder opens it. This means you can:

  • Change a built-in theme by editing its file. When you save it, Ettin Edit reloads it within a second. If the file has a mistake, the editor keeps the last version that worked and a message names the file and line, with an Open button. (View > Theme > Reload Themes reloads them all.)
  • Add a theme by dropping any .tmTheme file into the folder. Themes you add appear under Custom in View > Theme. Thousands of .tmTheme files exist for TextMate, Sublime Text and other editors.
  • Share a theme by sending someone the file.

When Ettin Edit is updated, built-in themes you haven't edited are updated with it; ones you have edited are left alone. View > Theme > Restore Built-in Themes puts the original built-in themes back and keeps each edited copy as <name>.tmTheme.bak, so nothing is lost.

Edit Theme Colours

View > Theme > Edit Theme Colours… changes a theme without touching its file by hand. Every change shows in the editor at once and is saved to the theme's file half a second after you stop, so you can see what you're doing and there's nothing to remember to save.

Theme Colours in the Simple view: named colours from Default text to Errors with colour swatches and B, I, U buttons, Window colours below them, and on the right a JavaScript preview where the word function was clicked with What colours this?, which says This is Keywords and shows its scopes

  • Theme at the top picks the theme to edit (and switches to it).
  • Simple and Advanced (scopes) switch between the two views described below. A preview of a short sample (JavaScript, Python, Rust, HTML or JSON) sits on the right of both.
  • Undo Changes puts the theme back exactly as it was when you opened the window. The window says how many settings you've changed since then.
  • Reset puts a built-in theme back as Ettin Edit ships it. (Themes you added have no original to go back to, so only Undo Changes works for them.)
  • Save As New Theme… saves your changes as a new theme with a name you choose and puts the original back as it was, so you can experiment on a built-in theme and keep the result separately.
  • Close keeps the changes.

Simple and Advanced

The Simple view has ten named colours: Default text, Comments, Strings, Numbers, Keywords, Functions, Types, Tags, Attributes and Errors. Each has a colour, B, I and U for bold, italic and underline, and a background colour when the theme gives it one (Errors usually have one). Hover over a name to see the scopes it stands for.

Changing one changes that kind of text in every language at once: Keywords recolours fn and if in Rust, def and return in Python, true and null in JSON, and so on. Behind the scenes Ettin Edit updates every rule that colours only that kind of text and adds one rule, named after the colour, for all of its scopes. Rules for special places keep their own colours, such as the colour some themes give to JSON keys (which are strings too).

The Advanced (scopes) view is the theme as it is stored:

  • Editor colours: the Background, Text, Caret, Selection, Current line, Line numbers, Indent guides, Whitespace symbols, Search matches, the Accent used for the current tab, buttons and fold markers, and the window colours below. Click a colour to change it, or Don't set this colour to fall back to the default.
  • Syntax colours are a list of rules. Each rule has a name, a Scope that says which text it colours, a colour, and B, I and U. Type in Find to look for a rule, such as string or comment. Add Rule adds one, and the button at the end of a rule deletes it. Every rule of the built-in themes has a name.

What colours this?

Not sure which colour a word uses? Click 🎯 What colours this?, then click the word, either in the preview or in the editor behind the window. The window selects its Simple colour and tells you:

  • its scope, and every scope around it (outermost first),
  • the rule that colours it, and
  • whether changing the Simple colour will change it. A word coloured by a rule for a special place (a JSON key, say) has to be changed in Advanced; Show in Advanced jumps to that rule and marks it with ▶.

Window colours

The Window colours in the Simple view are the Tab strip, Panels and dialogs, Status bar, Ribbon and menu bar, and Selection. Leave one on Automatic to have it worked out from the editor colours, as Ettin Edit always did; Set gives it a colour of its own. They're stored with the theme's editor colours as ettinTabStrip, ettinPanels, ettinStatusBar and ettinRibbon (selection is the usual selection), so they travel with the theme file. Other editors that read .tmTheme files ignore them, and themes without them work as before.

Scopes

Languages label each piece of text with a scope, such as comment.line.double-slash.rust or string.quoted.double.json. A rule's scope colours every piece of text whose scope starts with it, so string colours every kind of string in every language, and string.quoted.double.json only colours double-quoted strings in JSON. The most specific rule wins. Separate several scopes with commas.

The scopes most themes set are comment, string, constant.numeric, constant.language, keyword, storage, entity.name.function, entity.name.type, variable, support.function and invalid. See Languages for the scopes your own languages use.

Fonts

The editor's font and size are in Preferences, not in the theme, so they stay the same whichever theme you pick.

Languages in Ettin Edit

Ettin Edit colours code with Sublime Text–style grammars. It ships with the usual set (C, C++, C#, Java, Python, Rust, Go, JavaScript, HTML, CSS, SQL, Markdown, JSON, YAML, XML, shell scripts and more), plus its own grammars for:

  • TOML
  • INI and other key/value files: .ini, .cfg, .conf, .properties, .desktop, .reg, .inf, .editorconfig, .gitconfig and systemd units (.service, .socket, .timer and the rest)
  • TypeScript (.ts, .mts, .cts) and TSX
  • PowerShell
  • Dockerfile (also Containerfile and Dockerfile.*)
  • HL7 v2 messages (the separators are read from each MSH segment)
  • Kotlin, Swift, Dart, Zig
  • CMake, Nginx, .env files
  • Protocol Buffers, GraphQL, Terraform / HCL

Pick a language for the current file from the Language menu. Ettin Edit chooses one when a file opens, by its name, its extension and finally its first line (a shebang such as #!/usr/bin/env python3).

You can add your own languages, or replace a built-in one, in three ways:

  • fill in the Define Language form (the quickest),
  • write a short .lang.json file (no regular expressions needed), or
  • drop in a .sublime-syntax grammar.

The languages folder

Put language files in the languages folder inside the Ettin Edit settings folder:

  • Linux: ~/.config/EttinEdit/languages
  • Windows: %APPDATA%\EttinEdit\languages

Language > Open Languages Folder opens it (and creates it the first time). Language > Define Language… fills in a form and saves the file there, and Language > New Language… puts a commented template there and opens it. Ettin Edit reads the folder when it starts, and while it runs it notices when you add or save a file there and reloads it within a second, so tabs in that language are coloured again straight away. Language > Reload Languages reads the whole folder again.

  • When a file you save has a mistake, Ettin Edit keeps the version that worked before and shows a message with the file, the line and an Open button.

  • A file that cannot be loaded at start-up is skipped. Ettin Edit tells you which file it was and why; the other files still load.

  • A language with the same name as a built-in one replaces it. For example, a file with "name": "Python" takes over .py files.

  • If two of your files use the same name, the one that comes later in alphabetical order wins.

Define Language

Language > Define Language… describes a simple language in a form, with a live preview, and saves it as a .lang.json file in the languages folder.

The Define Language window filled in for Gcode: extensions gcode nc, line comment semicolon, block comment in round brackets, a Motion keyword list G0 G1 G2 G3 coloured as Keywords and a Machine list M3 M5 M30 coloured as Functions; on the right a preview of a G-code file with the codes, comments and numbers coloured

  • Name is what the Language menu shows, and File extensions (separated by spaces, such as gcode nc) decide which files open in it.
  • Line comment markers (separated by spaces) and a Block comment's start and end.
  • Strings in "…", '…' or both, whether \ escapes the next character, and whether they Can span lines.
  • Colour numbers, and Also right after a letter (X10) for languages such as G-code where a letter and a number go together; without it, the 10 in X10 stays uncoloured like part of a name. Ignore case in keywords so that IF, If and if all match.
  • Operators (separated by spaces) and Folding pairs, such as { }, if end, for code folding.
  • Keyword lists: give each list a name, its words (separated by spaces) and one of the Simple theme colours: Keywords, Functions, Types, Numbers, Strings, Comments, Tags, Attributes or Errors. + Add list adds another.

The preview on the right shows a sample made from what you've typed. Use current tab previews the active tab's first lines instead, and you can type or paste your own text into the preview too. Save Language writes languages/<name>.lang.json, reloads the languages and switches open tabs with its extensions to it.

To change a language later, pick it from the Language list at the top of the window (or open the window while its .lang.json file is the active tab). The form shows any file that only uses what the form has. A file that uses more, such as a first_line pattern or a type keyword group, opens with a note saying what the form can't show and an Open the JSON button. Edit JSON instead opens the file (or, for a new language, the commented template) in a tab.

The form keeps to what most simple languages need. Rules made of regular expressions or nested parts are for Sublime Text grammars.

User-defined languages (.lang.json)

A .lang.json file describes a language by its comments, strings and keywords. Ettin Edit turns it into a grammar when it loads it. Save the file as <anything>.lang.json, for example mylang.lang.json.

Here is a complete example. Keys that start with _ are notes and are ignored, so you can keep them as comments:

{
  "_about": "An Ettin Edit user-defined language. Keep it in the languages folder as <something>.lang.json, then choose Language > Reload Languages. Keys that start with _ are notes and are ignored.",

  "name": "My Language",
  "extensions": ["mylang"],

  "_first_line": "Optional regular expression tried on the first line of files whose extension is unknown, for example a shebang.",
  "first_line": "^#!.*\\bmylang\\b",

  "_case_sensitive": "false makes keywords match in any case (IF, If, if).",
  "case_sensitive": true,

  "line_comment": ["//", "#"],
  "block_comment": [["/*", "*/"]],

  "_strings": "Each entry is [open, close] or [open, close, escape]. Strings end at the end of the line unless multiline_strings is true.",
  "strings": [["\"", "\"", "\\"], ["'", "'", "\\"]],
  "multiline_strings": false,

  "_keywords": "Groups: keyword, type, constant, builtin, modifier, operator, variable, or a scope name such as support.class.",
  "keywords": {
    "keyword": ["if", "then", "else", "elif", "end", "while", "for", "in", "return", "break"],
    "type": ["int", "float", "string", "bool"],
    "constant": ["true", "false", "nil"],
    "builtin": ["print", "len", "open"]
  },

  "operators": ["+", "-", "*", "/", "%", "=", "==", "!=", "<", "<=", ">", ">=", "&&", "||", "!"],
  "numbers": true,

  "_folding": "Pairs that open and close a block, for code folding: brackets such as { } or words such as if … end.",
  "folding": [["{", "}"], ["if", "end"]]
}

Only name is required. Everything else is optional.

KeyMeaningDefault
nameThe name shown in the Language menu.(required)
extensionsFile extensions without the dot, such as ["mylang", "ml2"]. A single string also works.none
first_lineA regular expression tried on the first line of a file whose extension is not known, such as a shebang.none
case_sensitivefalse makes keywords match in any case (IF, If, if).true
line_commentMarkers that start a comment running to the end of the line. A single string also works.none
block_comment[open, close] pairs, such as [["/*", "*/"]].none
strings[open, close] or [open, close, escape] entries. When the escape is the same as the close (["'", "'", "'"]), a doubled quote stays inside the string, as in SQL.none
multiline_stringstrue lets strings run over several lines. Otherwise a string ends at the end of its line, so a missing quote only spoils one line.false
keywordsGroups of words, coloured by group (see below). Words match whole words only.none
keyword_listsNamed word lists coloured with a Simple theme colour, as Define Language writes them: [{"name": "Motion", "colour": "keywords", "words": ["G0", "G1"]}]. The colour is one of keywords, functions, types, numbers, strings, comments, tags, attributes or errors.none
operatorsSymbols to colour as operators, such as "+" or "==".none
numbersColour numbers (42, 3.14, 1e-9, 0xFF).true
numbers_after_lettersAlso colour a number right after one letter, such as the 10 in G-code's X10. Longer words (abc12) are left alone.false
foldingPairs that open and close a block, such as [["{", "}"], ["begin", "end"]]. Code folding follows them; word pairs are coloured as keywords. Without pairs, ( ), [ ] and { } fold, or failing that, indentation.none

A key Ettin Edit does not recognise is reported as an error, so a typo such as "line_coment" does not go unnoticed.

Keyword groups

The group name decides the colour, using the same scopes as the built-in grammars, so every theme already knows how to colour them:

GroupUsed forScope
keywordcontrol words: if, while, returnkeyword.control
typetype names: int, stringstorage.type
constanttrue, false, nullconstant.language
builtin (or function)built-in functionssupport.function
modifierpublic, static, conststorage.modifier
operatorword operators: and, or, notkeyword.operator.word
variableself, thisvariable.language

Plural names (keywords, types and so on) work too. For anything else, use a scope name with a dot, such as "support.class" or "entity.name.tag".

Sublime Text grammars (.sublime-syntax)

For full control, write a grammar in the sublime-syntax format and save it in the languages folder with the .sublime-syntax extension. Ettin Edit loads it as it is.

  • The grammar's name is what the Language menu shows. Without one, the file name is used.
  • file_extensions and first_line_match decide which files it opens.
  • The grammar needs a main context, and every context it refers to must exist. A grammar that fails these checks is skipped with a message, rather than leaving files uncoloured.
  • Ettin Edit uses the syntect engine, which supports nearly all of the format. Grammars that need the newest Sublime Text features (such as extends or branch_point) may not load.

Only use grammars whose licence lets you use them.

Indentation

Each language can have its own tab width and tabs-or-spaces, set under Preferences > Languages. Out of the box JSON and YAML use 2 spaces, and Makefiles and Go use tabs. When Detect indentation when a file opens is on (the default), a file that's already indented a clear way keeps its own style.

Colours

Grammars only label the text (a keyword, a string, a comment). The theme decides the colours, so a new language follows whichever theme you pick from View > Theme.

Code folding

Folding follows each language's grammar, so a block ends where its closing bracket, tag or keyword is, wherever the indentation says it does. What folds:

  • brackets: { }, [ ] and ( ) spread over several lines; brackets inside strings and comments don't count
  • tags in HTML, XML, SVG and JSX (<br> and other empty HTML elements, and <tag/>, don't open a block), and the code inside <script> and <style>
  • keyword blocks: Ruby and Lua (def/function/if/do … end), shell scripts (if … fi, case … esac, do … done), Pascal (begin … end), CMake (if() … endif() and the rest), and folding pairs in .lang.json languages
  • LaTeX \begin{…} … \end{…}
  • [sections] in INI and TOML files, and Markdown headings (down to the next heading of the same or a higher level) and fenced code blocks
  • comment blocks: a multi-line comment, or two or more lines of line comments
  • #region … #endregion markers, in a comment (// #region Name, <!-- #region -->) or as C#'s and C++'s #region / #pragma region

The line with the closing bracket stays visible, so } else { keeps working. Python, YAML, Haskell, Makefiles, plain text and files without any blocks fold by indentation, as do files over 300,000 lines.

Completion and parameter hints

As you type, the completion list offers words from the document, the language's keywords, and the functions it knows about. A function shows its signature next to its name. Ctrl+Space opens the list early.

Typing ( after a function's name shows its parameters above the caret, with the one you're typing in bold. It follows the caret from argument to argument and closes when you leave the call or press Esc. Ctrl+Shift+Space shows it again. The signatures come from:

  • the functions the document itself defines (Rust, C, C#, Java, Kotlin, Go, JavaScript, TypeScript, PHP, Python, Ruby, Lua and the other languages the function list understands), and
  • lists of common built-in and library functions for Python, JavaScript and TypeScript, Rust, C, C++, C#, Java, Go, PHP, Lua, Ruby, Kotlin, Swift, SQL, PowerShell and CSS. HTML, CSS, SQL and shell scripts have keyword lists.

Languages without a list (including your own .lang.json ones) still complete the keywords their grammar colours.

Each of these can be turned off in the Settings menu or in Preferences: Word Completion, Keyword and Function Completion, and Parameter Hints.

Your own lists

Put .json files in the api folder next to the languages folder (Language > Open Completion Lists Folder creates it with an example), then choose Language > Reload Languages. A list adds to the built-in one for the same language:

{
  "languages": ["Python"],
  "ignore_case": false,
  "keywords": ["my_keyword"],
  "functions": [
    "my_function(first, second=2) -> int",
    {"signature": "mymodule.helper(path, *, verbose=False)", "doc": "Shown under the signature."}
  ]
}
KeyWhat it is
languagesThe languages the list is for, named as in the Language menu.
ignore_casetrue when IF and if are the same word (SQL, PowerShell).
keywordsWords to offer in the completion list.
functionsSignatures, name(parameters) with anything after the ), such as a return type. A qualified name (os.path.join, std::mem::swap, Math.max) matches calls written either way, join( or os.path.join(. Write {"signature": …, "doc": …} to add a description.

Translations

Ettin Edit's menus, dialogs and messages can be shown in another language. It comes with English, German (Deutsch), French (Français) and Spanish (Español), and you can add more languages or change any translation with a text file.

The German, French and Spanish translations are machine-made starting points. They haven't been checked by native speakers yet, so some wording will be clumsy or wrong. Corrections are very welcome: see Improving a translation.

Choosing the language

Open Settings > Preferences… (Ctrl+,). Interface language is at the top of Files and Startup.

  • Same as the system (the default) follows your system's language. On Linux that's the LANGUAGE, LC_ALL, LC_MESSAGES or LANG setting; on Windows it's the language in your region settings. A regional language uses its base language when there's no translation for the region, so de_AT gets German. A language with no translation gets English.
  • Or pick a language from the list.

The window changes language at once; there's nothing to restart.

What stays in English

  • The user manual, including the in-app copy.
  • Names of programming languages and themes, and Plain Text.
  • Messages from the text tools' parsers, such as a JSON or XML syntax error and its line number, and messages from XPath, XSD, XSLT and SQL.
  • Messages from plugins, unless the plugin translates them itself (see Writing plugins).
  • Templates Ettin Edit writes for you, such as a new language file.

Right-to-left languages such as Arabic and Hebrew can't be shown correctly yet, because the toolkit Ettin Edit is drawn with doesn't lay out right-to-left text.

The translations folder

Open Translations Folder, next to the language list in Preferences, opens the translations folder in your settings folder, creating it if needed. It also puts english-source.ftl.txt there: every message in English, with notes, kept up to date by Ettin Edit. Copy from it; don't edit it, because it is replaced each time.

Each file in the folder is named after its language code, such as pt.ftl for Portuguese, pt-BR.ftl for Brazilian Portuguese, or de.ftl for German. When you save a file there, Ettin Edit reloads it within a second and the menus change to match. If the file has a mistake, the last version that worked stays in use and a message gives the line and column, with an Open button. Reload next to the language list reads the folder again.

Adding a language

  1. Copy english-source.ftl.txt to a new file named after the language, such as it.ftl.
  2. Change language-name = English to the language's own name, such as language-name = Italiano. That's the name shown in the list.
  3. Translate the text after each =. Leave the ids before the =, and anything in { $braces }, as they are.
  4. Save the file, then pick the language in Preferences (press Reload if it isn't listed yet).

You don't have to translate everything at once. Any message the file doesn't have is shown in English.

Improving a translation

A file for a language Ettin Edit already has is used on top of the built-in translation, message by message. So to fix a few German messages, make a de.ftl that holds only those messages:

save-as = Speichern als …
find-hint = Suchen

To share your fixes with everyone, send them to the project on GitHub. The built-in files are in assets/i18n in the source.

The file format

The files use Fluent, a format made for translating software. Most lines are just id = text. A few things to know:

  • Text in { $braces } is filled in by Ettin Edit, such as a file name or a count. You can move it within the sentence, but keep its name.

  • A long message can continue on the next lines, indented by spaces.

  • Lines starting with # are notes and are ignored.

  • Messages that depend on a number choose between forms:

    differences-count = { $count ->
        [one] { $count } difference
       *[other] { $count } differences
    }
    

    The names in brackets are the language's plural forms (zero, one, two, few, many and other), and the one marked * is used when no other fits. Use the forms your language needs; Polish, for example, uses one, few, many and other.

If a file has a mistake, Ettin Edit shows a message naming the file and the problem when it loads it, and still uses the rest of the file.

Accessibility

Ettin Edit works with screen readers, and everything in it can be reached from the keyboard.

Screen readers

Ettin Edit publishes its window to the system's accessibility service (AT-SPI on Linux, UI Automation on Windows), so screen readers such as Orca and NVDA can read it. Buttons, tick boxes, menus, text boxes and tabs are read by name.

Buttons that show only an icon or a symbol still have a name for the screen reader, and the same name shows as a tooltip when you hover over them. For example:

  • the find bar's Aa, W, \n and .* are read as Match case, Whole word, Extended (with what it means) and Regular expression, and as on or off;
  • the row of icons under the list in Transform > Recipes is read as New recipe, Duplicate, Delete…, Export Recipe…, Import Recipes…, Open Recipes Folder and Read the recipes folder again;
  • B, I and U in Theme Colours are read as Bold, Italic and Underline;
  • toolbar buttons that have lost their labels in a narrow window (see the toolbar) are read by their full names, and a collapsed group by the group's name.

On Linux, Orca reads applications through AT-SPI; turn it on in your desktop's accessibility settings (or run orca), then start Ettin Edit.

The keyboard

  • Tab and Shift+Tab move between the controls of a window or dialog, and through the menu bar, the toolbar's tabs and its buttons; the one that has focus is outlined, and Space or Enter presses it. In the editor itself Tab indents, so click the status bar first to move through the window's controls.
  • Every menu command can have a shortcut; see Keyboard shortcuts and the Shortcut Mapper.
  • View > Command Palette… (F1) finds and runs any command by typing part of its name.
  • Tapping Alt shows the menu bar while it is hidden.

Seeing more clearly

  • View > Zoom In and Zoom Out (Ctrl+= and Ctrl+-) change the text size of the editor.
  • The light and dark themes can be changed, down to every colour, in View > Theme > Edit Theme Colours….

If something can't be reached or isn't read out, please open an issue.

Using plugins

Plugins add transforms, commands, shortcuts and panels to Ettin Edit. They're written in Python or JavaScript, so anyone who knows either can make one: Plugins > New Plugin… writes a working one to start from. See Writing plugins.

A plugin's transforms work like the built-in ones: they're in Transform > Plugin Transforms (under the plugin's name), the command palette, the recipe window's Add Step list, and the right-click menu of the languages they're for. They run on each selection or the whole tab as one undo step, show a preview and their options before they run, and can send the result to a new tab or the clipboard. See Transforming text.

Many things that need a plugin in other editors are built into Ettin Edit already: the JSON, XML and MIME tools, Compare and CsvQuery.

What you need

  • Python plugins need Python 3 installed. Most Linux systems have it; on Windows, install it from python.org or the Microsoft Store.
  • JavaScript plugins need Node.js 18 or newer.

Ettin Edit finds them on the PATH. If it can't, or you want a different one, set the program in Plugins > Manage Plugins or Preferences > Plugins.

Trying the samples

Plugins > Install Sample Plugins installs and starts four plugins:

PluginLanguageWhat it does
Text StatisticsPythonLive counts for the current tab in a side panel (Ctrl+Alt+T), word frequencies as CSV in a new tab, and a word count of the selection
Markdown OutlineJavaScriptA clickable outline of a Markdown file's headings, Insert UUID, and Wrap Lines… to a width you choose
Markdown Preview (plugin example)PythonHow the built-in Markdown Preview could be written as a plugin (see below)
HL7 ViewerPythonBrowse and edit HL7 v2 messages, and the Explode HL7 Segments transform (see below)

A notice says how many were installed. Their commands appear in the Plugins menu, under each plugin's name, and in the editor's right-click menu.

Markdown Preview (plugin example)

Since Ettin Edit 2.3 the Markdown preview is built in: View > Markdown Preview (Ctrl+Shift+M, see Views). This sample does the same thing as a plugin, so you can read how a markdown panel that follows the text is written. Run it from Plugins > Markdown Preview (plugin example) > Show or Hide Markdown Preview (plugin example); it has no shortcut.

HL7 Viewer

HL7 v2 is the message format hospitals use to pass patient, order and result data between systems. Open a message (or choose Plugins > HL7 Viewer > Open Sample HL7 Message), then Show or Hide HL7 Viewer (Ctrl+Alt+H):

  • A tree on the right shows the message's segments, fields, repetitions, components and subcomponents. It follows the caret, and clicking a node selects that part of the text.
  • An inspector shows the selected piece's designation (such as PID-5.1), its name, data type, whether it's required or repeatable, its length and its table, from the HL7 v2.5.1 definitions. Change the value there to edit the message.
  • Copy HL7 Field Designation copies the designation of the piece at the caret.
  • Explode HL7 Segments (Transform > Plugin Transforms, or right-click in an HL7 tab) puts each field on its own line with its designation and name, such as PID-5 Patient Name: Quillfeather^Maribel^June, which is easier to read and to compare. Its options leave out the names or show empty fields too.

The separators are read from each MSH segment, so messages with unusual delimiters work too. HL7 files are coloured by the built-in HL7 language.

Installing plugins

Plugins > Manage Plugins… has two tabs:

  • Available lists the plugins in the Ettin Edit plugin index. Type in the filter box to search by name, author or description, and click Install. So far the index holds only the sample plugins; while that's so, the tab says so and links to how to submit yours.
  • Installed lists your plugins, and offers Update to x.y when the index has a newer version.

You can also install a plugin someone sent you: Install from File… takes a .zip, and Install from Folder… copies a folder that has a plugin.json in it. Or copy the folder into the plugins folder yourself (Plugins > Open Plugins Folder): Ettin Edit notices the new folder within a few seconds and asks whether to let it run. Removing a plugin's folder stops it. Plugins > Reload Plugins reads the folder again at once.

Permission to run

A plugin is a program that runs with your user account: it can read and change your documents and files and use the network, like any program you install. So the first time Ettin Edit finds a plugin, and again whenever its files change, it asks whether to let it run. Choose Allow only for plugins you trust. Don't Allow turns the plugin off; you can turn it on later in Manage Plugins.

The samples you install from the Plugins menu, and plugins you make with New Plugin…, don't ask.

Managing plugins

In the Installed tab of Plugins > Manage Plugins…, each plugin shows whether it's running, stopped or waiting for permission. Under its description, Adds: lists the commands it adds and the shortcut each one runs with now (after any change you made in the Shortcut Mapper). Type in the Filter box at the top to find a plugin by its name, description or one of its commands. Each plugin has:

  • an Enabled tick box to turn it on or off,
  • Start, Stop and Restart,
  • Open Folder, to see or edit its files,
  • Options…, when the plugin has settings you can change: a form with a field for each, saved as you change them,
  • Remove…, which moves its folder (and its saved settings) to the trash, so you can get it back,
  • Don't ask when it changes and Reload when its files change, for a plugin you're writing yourself.

Under the commands, Transforms: lists the transforms it adds. The New Plugin… button at the bottom does the same as Plugins > New Plugin….

If a plugin fails to start, the reason is shown under its name. Plugins > Reload Plugins stops every plugin, looks for plugins again, and starts them.

The plugin log

Plugins > Plugin Log shows what plugins print, their errors, and anything Ettin Edit refused, such as a shortcut that clashes with one that's already taken. Look here first when a plugin doesn't behave. Copy All copies the log, for a bug report.

A plugin that crashes shows a notice and stops; it can't take Ettin Edit or your documents down with it. When the error happened in one of the plugin's own files, the notice says which file and line, and Open opens it there. Edits a plugin makes are undone in one step, like any other edit.

Plugin shortcuts

Plugins can give their commands shortcuts. A shortcut that's already used by Ettin Edit or another plugin is refused, with a line in the log. You can change or add plugin shortcuts in the Shortcut Mapper, like any other command's.

Writing Ettin Edit plugins

A plugin adds transforms, commands, shortcuts and panels to Ettin Edit. You write it in Python or JavaScript, whichever you prefer.

Most plugins are best written as a transform: a function that takes text and returns new text. Ettin Edit does the rest. It runs the function on each selection (or the whole tab) as one undo step, shows a preview, asks for the options, lets the user send the result to a new tab or the clipboard, and lets them use it as a recipe step, even from the command line.

Quick start

  1. Choose Plugins > New Plugin…. Give it a name, pick Python or JavaScript and what it starts with (a transform, a command or a panel), and click Create and Open. Ettin Edit writes a working plugin to your plugins folder, starts it and opens its main file.
  2. Try it: a transform is in Transform > Plugin Transforms, a command in the Plugins menu.
  3. Edit the main file and save. With Reload when its files change ticked (it is, for a new plugin), Ettin Edit restarts the plugin within a second, so your change is ready to try.

To learn from bigger examples, choose Plugins > Install Sample Plugins. Ettin Edit copies four working plugins into your plugins folder and starts them:

  • Text Statistics (Python)
  • Markdown Outline (JavaScript)
  • Markdown Preview (plugin example) (Python): how the built-in Markdown Preview could be written as a plugin, with a markdown panel that updates as you type
  • HL7 Viewer (Python): a bigger example, with a tree panel, an inspector panel, a transform (Explode HL7 Segments) and its own unit tests

You can also copy one of the sample folders (Plugins > Open Plugins Folder), rename it and edit it; Plugins > Reload Plugins runs your changes.

The plugins folder is ~/.config/EttinEdit/plugins on Linux and %APPDATA%\EttinEdit\plugins on Windows.

Ettin Edit used to be called NixPad. Plugins written for it that import nixpad or require('nixpad') keep working; new plugins use ettin.

What you need

  • Python plugins run with the Python 3 installed on your computer (python3, or python / py on Windows).
  • JavaScript plugins run with Node.js 18 or newer (node).

If Ettin Edit can't find one of them, set its path in Plugins > Manage Plugins. Plugins can use any package you install for that Python or Node, such as one from pip or npm.

A plugin's folder

Each plugin is a folder in the plugins folder. The folder name is the plugin's id.

plugins/
  shout/
    plugin.json
    main.py

plugin.json describes the plugin:

{
  "name": "Shout",
  "version": "1.0.0",
  "description": "Makes the selection upper case.",
  "author": "You",
  "main": "main.py"
}
FieldMeaning
nameShown in menus. Defaults to the folder name.
mainThe script to run, inside the folder. Defaults to main.py or main.js.
runtime"python" or "node". Only needed when main doesn't end in .py or .js.
version, description, authorShown in Manage Plugins.
optionsSettings the user can change in Manage Plugins (see Settings and options).

A new plugin from Plugins > New Plugin… also gets ettin.pyi (Python) or ettin.d.ts (JavaScript) next to its main file: type hints for the whole API, so editors such as VS Code or PyCharm can complete names and check calls. The same files are in the .sdk folder inside the plugins folder.

Folders whose names start with . or _ are skipped. Rename a folder to _shout to hide a plugin without deleting it.

Permission to run

A plugin is a program that runs with your user account. It can read and change your open documents and any of your files, and it can use the network. Only run plugins you trust.

The first time Ettin Edit finds a plugin, it asks whether to let it run. It asks again whenever any file in the plugin's folder changes. If you choose Don't Allow, the plugin is turned off. You can turn it back on in Plugins > Manage Plugins.

Ettin Edit doesn't ask about the sample plugins you install from the Plugins menu, or about a plugin you make with New Plugin…. While you write a plugin of your own, tick Don't ask when it changes for it in Manage Plugins, so reloading it doesn't ask each time.

Reloading as you write

Tick Reload when its files change on a plugin's card in Plugins > Manage Plugins (a plugin made with New Plugin… has it ticked). Ettin Edit then watches the plugin's folder and restarts the plugin half a second after you stop saving files there, so a change is running within a second. The plugin log says when it reloaded.

If the plugin fails to start, or an error stops it, Ettin Edit shows the error with the file and line it happened on, and an Open button that opens that file at that line. The full traceback is in the plugin log.

Sharing plugins

Plugins > Manage Plugins has two tabs. Installed lists your plugins, with Remove… (the folder moves to the trash) and Update to x.y when the plugin index has a newer version. Available lists the plugins in the index, with a filter box and an Install button. Install from File… installs a .zip, and Install from Folder… copies a folder that has a plugin.json. A plugin you install or update always asks for permission before it runs, even if you ticked Don't ask when it changes.

To share a plugin, zip it. plugin.json can be at the top of the zip or inside one folder:

shout.zip                 shout.zip
  plugin.json               shout/
  main.py                     plugin.json
                              main.py

The plugin's id (its folder name) comes from the index, otherwise from the folder in the zip, otherwise from the zip's file name. Zips with absolute paths or .. in them are refused.

Submitting a plugin to the index

The Available tab lists the plugins in the plugin index. While it holds only the sample plugins, the tab says so and links here. To list your plugin:

  1. Zip it as shown above and put the zip somewhere with a stable https:// address, such as a release on your own GitHub repository.
  2. Fork Ettin Edit on GitHub, add an entry for your plugin to plugins/index.json (example below), and open a pull request. Say in it what the plugin does and which runtime it needs.
  3. Once the pull request is merged, everyone sees your plugin under Available after Refresh.

The index is a JSON file; Ettin Edit reads https://raw.githubusercontent.com/Tharkis/Ettin-Edit/main/plugins/index.json unless you change the address at the bottom of the Available tab. Each entry looks like this:

{
  "plugins": [
    {
      "id": "shout",
      "name": "Shout",
      "version": "1.0.0",
      "description": "Makes the selection upper case.",
      "author": "You",
      "homepage": "https://example.com/shout",
      "download": "https://example.com/shout-1.0.0.zip",
      "sha256": "optional: the zip's SHA-256, checked before installing",
      "min_app_version": "optional: the oldest Ettin Edit it works with"
    }
  ]
}

Versions are compared number by number, so 1.10 is newer than 1.9. A download address without https:// is relative to the index itself, so you can host your own index next to your zips. Each Ettin Edit release attaches <id>.zip for the sample plugins.

A Python plugin

import ettin

@ettin.command("Shout", shortcut="Ctrl+Alt+H")
def shout():
    doc = ettin.active()
    doc.replace_selections(doc.selected_text().upper())

@ettin.on("saved")
def saved(doc):
    ettin.log("Saved", doc.path)

ettin.run()

The script must end with ettin.run(). Calls are ordinary function calls that return when Ettin Edit has answered.

A JavaScript plugin

const ettin = require('ettin');

ettin.command('Shout', async () => {
  const doc = await ettin.activeDocument();
  await doc.replaceSelections((await doc.getSelectedText()).toUpperCase());
}, { shortcut: 'Ctrl+Alt+H' });

ettin.on('saved', (doc) => ettin.log('Saved', doc.path));

Every call returns a Promise, so use await. Use require, not import: Ettin Edit makes the ettin module available through NODE_PATH, and ES modules don't read that.

Transforms

A transform is a function that takes the text and its options and returns the new text. Five lines are enough:

import ettin

@ettin.transform("Reverse Lines", options={"skip_blank": False})
def reverse(text, options):
    lines = text.split("\n")
    return "\n".join(reversed(lines))

ettin.run()
const ettin = require('ettin');
ettin.transform('Reverse Lines', { skipBlank: false },
  (text, options) => text.split('\n').reverse().join('\n'));

A transform appears:

  • in Transform > Plugin Transforms, under the plugin's name;
  • in the command palette and the Shortcut Mapper, so it can have a shortcut;
  • in the recipe window's Add Step list, so it can be a recipe step;
  • on the right-click menu of tabs in the languages you list (languages=["JSON"] / { languages: ['JSON'] }).

When the user runs it, Ettin Edit sends the text of each selection (or the whole tab when nothing is selected) to the function, one call per selection, and puts the results back as one undo step. A transform with options opens a dialog first: a form for the options, a live preview of what the transform makes of the first lines, and Result goes to (this tab, a new tab or the clipboard). A transform without options runs straight away. Recording a recipe records the transform with the options used.

options is a dict (an object in JavaScript) of option names and their defaults. A true/false default gets a check box, a number a number box and text a text box (where \n stands for a line break). Your function always gets every option: the user's values, or the defaults for any they didn't set.

When the text can't be transformed, raise ettin.TransformError (throw new ettin.TransformError(message, { line, column }) in JavaScript). Ettin Edit shows the message and, when you give a line (and column), from 1, counted in the text you were given, moves the caret there. Any other error shows its message; the traceback goes to the plugin log. A json.JSONDecodeError from Python's json module is reported with its line and column automatically.

A transform has 10 seconds. After half a second Ettin Edit shows that it's running, with a Stop button; after 10 seconds it gives up and leaves the text as it was.

The optional id (the title by default) names the transform in recipes, so keep it the same when you rename the title. A recipe that uses a plugin's transform runs it from the command line too (ettin-edit --recipe NAME file); Ettin Edit starts the plugin for it, if it is allowed to run. If the plugin isn't installed or allowed, the recipe stops with an error that says which plugin it needs.

Settings and options

Each plugin has a settings store, kept in plugin-data/<id>/settings.json in Ettin Edit's config folder, next to the plugins folder. ettin.settings reads like a dict (a plain object in JavaScript) and is filled in before any command, event or transform runs. In Python, assigning saves straight away (ettin.settings["width"] = 80); in JavaScript call await ettin.setSettings({ width: 80 }).

ettin.data_dir() / ettin.dataDir() is a folder for the plugin's own files (caches, downloaded data). It is created when first asked for and kept when the plugin is updated, but removed with it.

To let users change settings without editing code, list them in plugin.json:

{
  "name": "Wrap",
  "options": [
    { "key": "width", "title": "Wrap at column", "type": "number", "default": 80 },
    { "key": "style", "title": "Style", "type": "choice",
      "choices": ["hard", "soft"], "default": "hard" },
    { "key": "keep_indent", "title": "Keep indentation", "type": "bool", "default": true,
      "description": "Wrapped lines start at the same column." }
  ]
}

type is string, bool, number or choice. The plugin's card in Manage Plugins then has an Options… button that opens a form for them. Changes are saved straight away and the plugin gets a settings.changed event with the new settings:

@ettin.on("settings.changed")
def changed(settings):
    ettin.log("Width is now", settings["width"])

Marks

A plugin can mark ranges of a document, for example to show where a linter found problems:

doc = ettin.active()
doc.mark("lint", [(10, 14), (52, 60)], style="underline-squiggle",
         color="warning", message="Unknown field")
doc.clear_marks("lint")
await doc.mark('lint', [[10, 14], [52, 60]], { style: 'underline-squiggle', color: 'warning', message: 'Unknown field' });
await doc.clearMarks('lint');

style is underline-squiggle (the default), background or gutter-icon (a small diamond beside the line). color is error (the default), warning, info or accent, in the theme's colours. Hovering over a mark shows its message. Marks move with the text as it is edited, and calling mark again with the same id replaces that set. A plugin's marks go away when it stops.

Status bar items

ettin.status("words", "1,204 words", tooltip="Words in this tab", command="count")
ettin.status("words", "")   # removes it
await ettin.status('words', '1,204 words', { tooltip: 'Words in this tab', command: 'count' });

Shows short text on the right of the status bar. Clicking it runs the plugin's command with that id: the id given to command, or else the function's name in Python (count above) and the title in JavaScript. A plugin can show up to four items.

Picking from a list

pick = ettin.choose(["UTF-8", "Latin-1", {"label": "UTF-16", "detail": "two bytes"}],
                    title="Encoding", placeholder="Type to filter")
const pick = await ettin.choose(['UTF-8', 'Latin-1'], { title: 'Encoding' });

Shows a list the user filters by typing, like the command palette. Returns the item picked (the string, or the dict/object) or None/null when the user closes it.

Printing and errors

Ettin Edit and the plugin talk over the plugin's standard input and output. print() in Python and console.log() in JavaScript are sent to the plugin log instead (Plugins > Plugin Log), so use them freely while debugging.

If a command or event handler throws an error, Ettin Edit shows a short message and writes the full traceback to the log. The plugin keeps running.

If the plugin itself stops, Ettin Edit shows the error with the file and line it happened on, and an Open button that opens the file there. Manage Plugins also shows why. Fix it, then click Start or choose Reload Plugins (or let Reload when its files change do it).

Text positions

Positions count characters (Unicode code points) from the start of the document, beginning at 0. Lines end with \n whatever the file uses on disk. Line and column numbers begin at 1.

In Python, string indexes already count code points, so positions match text[start:end]. JavaScript strings count UTF-16 units, which differ only for characters outside the Basic Multilingual Plane, such as emoji. Use Array.from(text) to index by code point when that matters.

API reference

Python names are shown first, JavaScript names second.

Commands and events

PythonJavaScriptWhat it does
@transform(title, options=None, id=None, languages=None)transform(title, options, fn, {id, languages})Adds a transform (see Transforms).
@command(title, shortcut=None, id=None, icon=None)command(title, fn, {shortcut, id, icon})Adds a command to the Plugins menu, with an optional shortcut and toolbar icon.
@on(event)on(event, fn)Calls the handler with a Document when the event happens.
run()(not needed)Handles commands and events until Ettin Edit stops the plugin.

Shortcuts are written like Ctrl+Alt+U, Ctrl+Shift+F9 or F6. They need Ctrl or Alt unless they use a function key. A shortcut Ettin Edit or another plugin already uses isn't added; the log says why.

Every command is also in the command palette, under its title with Plugin · your plugin's name after it, so give commands titles that say what they do on their own ("Explode JSON Lines" rather than "Run").

Users can put any plugin command on the toolbar. The icon is what its button shows there: a Phosphor icon name such as "star" or "chart-bar", or a .png file inside your plugin's folder, given relative to it ("icons/run.png"; 32×32 pixels looks sharp). An icon that isn't a known name or points outside the folder is left out and the log says why; the button then shows a puzzle piece.

@ettin.command("Count Words", shortcut="Ctrl+Alt+W", icon="hash")
def count_words():
    ...
ettin.command('Count Words', countWords, { shortcut: 'Ctrl+Alt+W', icon: 'hash' });

Events:

EventWhen
openedA tab opened.
savedA document was saved.
closedA tab closed. The document can no longer be used.
activatedAnother tab got focus.
changedThe text was edited. Sent after a short pause in typing.
caretThe caret or selection moved in the active tab. Sent after a short pause.
shutdownEttin Edit is closing or stopping the plugin. No argument.
settings.changedThe user changed the plugin's options. Called with the new settings.

Documents

PythonJavaScriptWhat it does
active()activeDocument()The document in the tab that has focus.
documents()documents()Every open document, in tab order.
open_file(path)openFile(path)Opens a file, or shows it if it's already open.
new_document(text="", language=None)newDocument(text, language)Opens a new tab. language is a name from the Language menu, such as "JSON".

A Document has these properties, read when you got it (refresh() updates them): id, title, path (None/null for a new tab), language, modified, read_only/readOnly, length, line_count/lineCount, encoding, line_ending/lineEnding and caret (line and column of the main caret) and caret_offset / caret.offset (its text position).

PythonJavaScriptWhat it does
get_text(start=None, end=None), textgetText(start, end)The whole text, or part of it.
set_text(text), text = ...setText(text)Replaces the whole text.
replace(start, end, text)replace(start, end, text)Replaces part of the text.
insert(text)insert(text)Types text at every caret, replacing what is selected.
selections()getSelections()Each selection: start, end, anchor, head and text. The main one is first.
selected_text()getSelectedText()All selected text, joined with new lines.
replace_selections(text_or_list)replaceSelections(textOrArray)Replaces each selection with the same text, or one string per selection.
select(start, end=None)select(start, end)Selects a range, or moves the caret.
select_ranges([(start, end), ...])selectRanges([[start, end], ...])Makes several selections.
goto(line, column=1)goTo(line, column)Moves the caret and scrolls to it.
save()save()Saves. Asks for a name if the tab has none. Returns whether it saved.
activate()activate()Shows the tab.
close()close()Closes the tab. Asks first if there are unsaved changes.
mark(id, ranges, style, color, message)mark(id, ranges, {style, color, message})Marks ranges (see Marks).
clear_marks(id)clearMarks(id)Removes the marks made with that id.

Each edit is one undo step, so Undo reverses it. Editing a read-only document raises an error.

Messages, input and more

PythonJavaScriptWhat it does
message(text, kind="info")message(text, kind)Shows a short message. kind is info, warning or error.
prompt(text, value="", title=None)prompt(text, {value, title})Asks for a line of text. Returns None/null if cancelled.
choose(items, title=None, placeholder=None)choose(items, {title, placeholder})Asks the user to pick from a list (see Picking from a list).
status(id, text, tooltip=None, command=None)status(id, text, {tooltip, command})Shows text in the status bar (see Status bar items).
settingssettings, setSettings(values)The plugin's settings (see Settings and options).
data_dir()dataDir()A folder for the plugin's own files.
set_clipboard(text)setClipboard(text)Copies text.
run_action(action)runAction(action)Runs one of Ettin Edit's own commands (see below).
ui_language()uiLanguage()The language Ettin Edit's menus are in, like "en" or "de" (see below).
log(*values)log(...values)Writes a line to the plugin log.

run_action takes the name of an Ettin Edit command, such as "Duplicate", "SelectAll", "Save", "FindNext" or "ToggleWordWrap". Commands that need options take an object, such as {"SortLines": {"kind": "IgnoreCase", "desc": false}} or {"ConvertCase": "Upper"}. Transform commands take their settings the same way, such as {"Transform": {"Convert": {"from": "Json", "to": "Yaml"}}}, {"Transform": {"Hash": "Sha256"}} or {"Transform": {"FilterLines": {"pattern": "ERROR", "regex": false, "match_case": true, "keep": true}}}. Recipes run by name: {"RunRecipe": "Tidy Whitespace"} works on the selections or the whole document, and {"RunRecipeOnAllTabs": "Tidy Whitespace"} on every open tab. A recipe with shell commands still asks the user first.

To find a command's id, right-click it in the command palette (F1) or in Settings > Shortcut Mapper and choose Copy Command ID. The ids of the built-in commands are also listed below.

Translating your plugin

Ettin Edit doesn't translate plugins, but it tells them which language its own menus are in, so a plugin can pick its own wording. ui_language() / uiLanguage() returns a language code such as "en", "de" or "pt-BR". Keep your strings in the plugin, with English as the fallback:

from ettin import active, command, message, ui_language, run

TEXT = {
    "en": {"title": "Count Words", "result": "{} words"},
    "de": {"title": "Wörter zählen", "result": "{} Wörter"},
}
lang = ui_language()
strings = TEXT.get(lang) or TEXT.get(lang.split("-")[0]) or TEXT["en"]

@command(strings["title"])
def count():
    message(strings["result"].format(len(active().text.split())))

run()

Command titles are set when the plugin starts. If the user changes the language in Preferences, the new titles appear after Plugins > Reload Plugins or the next start; messages that call ui_language() when they run follow the change straight away.

Panels

A panel is a side or bottom panel that your plugin describes as a list of items. Ettin Edit draws it. When the user clicks or changes something, your handler is called.

from ettin import ui

ettin.show_panel("todo", "To Do", [
    ui.input("task", hint="New task"),
    ui.button("add", "Add"),
    ui.table("list", ["Task", "Done"], [["Write docs", "no"]]),
])

@ettin.on_panel("todo")
def todo(event):
    if event["item"] == "add":
        ettin.message("Adding " + event["values"]["task"])
const { ui } = ettin;
await ettin.showPanel('todo', {
  title: 'To Do',
  items: [ui.input('task', { hint: 'New task' }), ui.button('add', 'Add')],
});
ettin.onPanel('todo', (e) => {
  if (e.item === 'add') ettin.message(`Adding ${e.values.task}`);
});

Calling show_panel again with the same id updates the panel in place, keeping where it is scrolled to; pass scroll_to_top=True (scrollToTop: true in JavaScript) to go back to the start, for example when the panel now shows something else. position is "right" (the default) or "bottom". close_panel(id) / closePanel(id) closes it.

Items:

HelperJSONNotes
ui.heading(text){"type": "heading", "text"}
ui.label(text, weak, mono){"type": "label", "text", "weak", "mono"}weak dims it; mono uses the code font.
ui.separator(){"type": "separator"}
ui.button(id, label){"type": "button", "id", "label"}Sends click.
ui.input(id, label, value, hint, multiline){"type": "input", ...}Sends submit when Enter is pressed.
ui.checkbox(id, label, value){"type": "checkbox", ...}Sends change with true or false.
ui.select(id, options, value, label){"type": "select", ...}A drop-down list. Sends change with the option.
ui.row(*items){"type": "row", "items"}Puts items side by side.
ui.tree(id, nodes, selected){"type": "tree", "id", "nodes", "selected"}Sends select with the node's id. selected (optional) is a node id to highlight; when it changes, the tree opens to it and scrolls it into view. In JavaScript: ui.tree(id, nodes, { selected }).
ui.node(label, id, detail, children, open){"label", "id", "detail", "children", "open"}A tree node. detail is dimmed text after the label.
ui.table(id, columns, rows){"type": "table", "id", "columns", "rows"}Click a header to sort. Sends select with the row's index in your rows.
ui.markdown(text, id, base, doc, line){"type": "markdown", "id", "text", "base", "doc", "line"}Markdown, drawn like the user manual: headings, lists, tables, quotes, code blocks with a Copy button, links. Web links open in the browser and #heading links scroll to the heading; any other link sends link with the link as value. id is optional. base (1.9) is the folder images with relative paths are in; without it, only the descriptions of images are shown. doc (1.9, a document or its id) makes the panel scroll along with that tab, and line is the tab's line (from 0) the text starts on, if you left some out at the top. In JavaScript: ui.markdown(text, { id, base, doc, line }). Needs Ettin Edit 1.5.

The handler gets: item (the item's id), event (click, change, submit, select, link or close), value, and values (every input, checkbox and select, by id). close means the user closed the panel.

A Markdown panel that follows the text, as the Markdown Preview (plugin example) sample does it, needs only a few lines:

@ettin.on("changed")
def changed(doc):
    folder = os.path.dirname(doc.path) if doc.path else None
    ettin.show_panel("preview", "Preview",
                     [ui.markdown(doc.get_text(), base=folder, doc=doc)])

Sending the same id again updates the panel and keeps its scroll position, so the preview doesn't jump while you type. With doc, the panel follows the tab's scrolling instead, and it only moves when the tab scrolls or the text changes, so the reader can still scroll it by hand.

Updating a panel keeps what the user typed in a field, unless you send a different value for it.

The protocol

You can write a plugin in another language by speaking the protocol directly. Ettin Edit starts main and sends JSON-RPC 2.0 messages on its standard input, one per line, UTF-8. The plugin sends requests and notifications on its standard output, one per line. Standard error goes to the log. Python plugins are run with python3 -u main.py and JavaScript plugins with node main.js, in the plugin's folder.

Ettin Edit sends these notifications:

  • initialize {plugin, ettin, api, language, settings, dataDir}. Always first. api is 2 since Ettin Edit 2.3 (1 before). language is the interface language, like en or de; settings the plugin's settings and dataDir its folder.
  • command {id}.
  • event {event, doc}. For settings.changed, {event, settings}.
  • panel {panel, item, event, value, values}.
  • shutdown {}. Finish within a second, or the plugin is stopped.

The plugin can call these methods. doc is a document id; it defaults to the active tab.

MethodParamsResult
commands.registerid, title, shortcut?, icon?{shortcut, warning}
transforms.registerid, title, options?, languages?
settings.getthe settings object
settings.setvaluesthe settings saved
marks.setdoc?, id, ranges: [[start, end]], style?, color?, message?
marks.cleardoc?, id
status.setid, text, tooltip?, command?
ui.chooseitems: [{label, detail?}], title?, placeholder?the index picked, or null
events.subscribeevents: [names]
documents.list / documents.active / documents.infodoc?document info
documents.openpathdocument info
documents.newtext?, language?document info
documents.activate / documents.closedoc?
documents.savedoc?true if saved
text.getdoc?, start?, end?string
text.setdoc?, text
text.replacedoc?, start, end, text
text.insertdoc?, text
selection.getdoc?[{start, end, anchor, head, text}]
selection.setdoc?, ranges: [[start, end]]
selection.replacedoc?, text or texts
editor.gotodoc?, line, column?
editor.runActionaction
ui.messagetext, kind?
ui.promptprompt, value?, title?string or null
clipboard.settext
app.languagethe interface language, like "de"
panel.showid, title?, items, position?
panel.closeid

Notifications the plugin can send: log {text, level?}, error {message}, which also shows a short message to the user, and ready {}, which says the plugin has registered its commands and transforms (a recipe run from the command line waits for it, up to 10 seconds).

Ettin Edit sends requests (with an id) for transforms, and the plugin answers each with a result or an error:

  • transform.run {id, text, options}: answer {"text": "..."}, or an error whose data may hold line and column (from 1) in the text.

A plugin should answer any other request it doesn't know with error -32601.

Command ids

The built-in commands and the ids run_action / runAction takes. Plugin commands are {"PluginCommand": {"plugin": "<plugin id>", "command": "<command id>"}} and plugin transforms {"PluginTransform": {"plugin": "<plugin id>", "transform": "<transform id>"}}. Ettin Edit checks this list against its commands when it is built.

CommandID
File › NewNewTab
File › Open…Open
File › SaveSave
File › Save As…SaveAs
File › Save AllSaveAll
File › Reload from DiskReloadFromDisk
File › Rename…RenameFile
File › Move to Trash…MoveToTrash
File › Open Containing FolderOpenContainingFolder
File › Open Terminal HereOpenTerminalHere
File › Print…Print
File › Export as HTML…ExportHtml
File › Open Folder as Workspace…OpenFolderAsWorkspace
File › Close WorkspaceCloseWorkspace
File › CloseCloseTab
File › Close AllCloseAll
File › Close OthersCloseOthers
File › Clear Recent FilesClearRecent
File › ExitQuit
Search › Find…Find
Search › Replace…Replace
Search › Find NextFindNext
Search › Find PreviousFindPrev
Search › Find Selected NextFindSelectedNext
Search › Find Selected PreviousFindSelectedPrev
Search › Find in Files…FindInFiles
Search › Find All in Current DocumentFindAllInDoc
Search › Find All in Open TabsFindAllInTabs
Search › Select All MatchesSelectAllMatches
Search › Mark All{"MarkAll":{"bookmark":false}}
Search › Clear All MarksClearMarks
Search › Go to Line…GoToLine
Search › Bookmark › Toggle BookmarkToggleBookmark
Search › Bookmark › Next BookmarkNextBookmark
Search › Bookmark › Previous BookmarkPrevBookmark
Search › Bookmark › Clear All BookmarksClearBookmarks
Search › Bookmark › Cut Bookmarked LinesCutBookmarkedLines
Search › Bookmark › Copy Bookmarked LinesCopyBookmarkedLines
Search › Bookmark › Remove Bookmarked LinesRemoveBookmarkedLines
Search › Bookmark › Remove Unbookmarked LinesRemoveUnbookmarkedLines
Search › Bookmark › Inverse BookmarksInverseBookmarks
View › Word WrapToggleWordWrap
View › Line NumbersToggleLineNumbers
View › Highlight Current LineToggleCurrentLine
View › Show Symbol › Show WhitespaceToggleWhitespace
View › Show Symbol › Show End of LineToggleEol
View › Show Symbol › Show Invisible CharactersToggleInvisible
View › Show Symbol › Show All CharactersToggleAllChars
View › Show Symbol › Indent GuidesToggleIndentGuides
View › Long-Line MarkerToggleEdge
View › Function ListToggleFunctionList
View › Document MapToggleDocMap
View › Character PanelToggleCharPanel
View › Hex ViewToggleHexView
View › Markdown PreviewToggleMarkdownPreview
View › Folder as WorkspaceToggleFolderPanel
View › Distraction-Free ModeToggleDistractionFree
View › Tab List…TabList
View › Move to Other ViewMoveActiveToOtherView
View › Clone to Other ViewCloneActiveToOtherView
View › Focus Other ViewFocusOtherView
View › Next TabNextTab
View › Previous TabPrevTab
View › Folding › Fold AllFoldAll
View › Folding › Unfold AllUnfoldAll
View › Folding › Fold Current LevelFoldCurrent
View › Folding › Unfold Current LevelUnfoldCurrent
View › Zoom InZoomIn
View › Zoom OutZoomOut
View › Reset ZoomZoomReset
View › Summary…Summary
View › Command Palette…CommandPalette
View › Toolbar › ToolbarToggleToolbar
View › Toolbar › Simplified ToolbarToggleSimplifiedToolbar
View › Toolbar › Collapse ToolbarCollapseToolbar
View › Menu BarToggleMenuBar
View › Toolbar › Customise Toolbar…CustomiseToolbar
View › Theme › Edit Theme Colours…StyleConfigurator
View › Theme › Open Themes FolderOpenThemesFolder
View › Theme › Reload ThemesReloadThemes
View › Theme › Restore Built-in ThemesRestoreThemes
Language › Define Language…DefineLanguage
Language › New Language…NewLanguage
Language › Open Languages FolderOpenLanguagesFolder
Language › Open Completion Lists FolderOpenApiFolder
Language › Reload LanguagesReloadLanguages
Language › Language GuideLanguageGuide
Settings › Preferences…Preferences
Settings › Shortcut Mapper…ShortcutMapper
Settings › Export Settings…ExportSettings
Settings › Import Settings…ImportSettings
Settings › Open Settings FolderOpenSettingsFolder
Settings › Auto-Close Brackets and QuotesToggleAutoClose
Settings › Smart IndentationToggleSmartIndent
Settings › Indent With SpacesToggleUseSpaces
Settings › Word CompletionToggleCompletion
Settings › Keyword and Function CompletionToggleLanguageCompletion
Settings › Parameter HintsToggleParameterHints
Settings › Single WindowToggleSingleInstance
Settings › Remember Unsaved Changes on ExitToggleRememberUnsaved
Settings › Reload Files Changed on Disk AutomaticallyToggleAutoReload
Transform › Macros › Start or Stop RecordingToggleMacroRecording
Plugins › Manage Plugins…ManagePlugins
Plugins › New Plugin…NewPlugin
Plugins › Plugin LogShowPluginLog
Plugins › Open Plugins FolderOpenPluginsFolder
Plugins › Reload PluginsReloadPlugins
Plugins › Install Sample PluginsInstallSamplePlugins
Plugins › Plugin GuidePluginGuide
Help › WelcomeWelcome
Help › User ManualUserManual
Help › User Manual on the WebWebManual
Help › Check for Updates…CheckForUpdates
Help › Check for Updates AutomaticallyToggleUpdateCheck
Help › About Ettin EditAbout
Transform › Filter Through Command…{"TransformDialog":"Pipe"}
Transform › Lines › Keep Matching Lines…{"TransformDialog":{"FilterLines":{"keep":true}}}
Transform › Lines › Remove Matching Lines…{"TransformDialog":{"FilterLines":{"keep":false}}}
Transform › Lines › Count Distinct Lines{"Transform":"CountLines"}
Transform › Lines › Sort Lines › Sort Lexicographically Ascending{"SortLines":{"kind":"Lexical","desc":false}}
Transform › Lines › Sort Lines › Sort Lexicographically Descending{"SortLines":{"kind":"Lexical","desc":true}}
Transform › Lines › Sort Lines › Sort Ignoring Case Ascending{"SortLines":{"kind":"IgnoreCase","desc":false}}
Transform › Lines › Sort Lines › Sort Ignoring Case Descending{"SortLines":{"kind":"IgnoreCase","desc":true}}
Transform › Lines › Sort Lines › Sort As Integers Ascending{"SortLines":{"kind":"Integer","desc":false}}
Transform › Lines › Sort Lines › Sort As Integers Descending{"SortLines":{"kind":"Integer","desc":true}}
Transform › Lines › Sort Lines › Sort As Decimals Ascending{"SortLines":{"kind":"Decimal","desc":false}}
Transform › Lines › Sort Lines › Sort As Decimals Descending{"SortLines":{"kind":"Decimal","desc":true}}
Transform › Lines › Sort Lines › Sort By Length Ascending{"SortLines":{"kind":"Length","desc":false}}
Transform › Lines › Sort Lines › Sort By Length Descending{"SortLines":{"kind":"Length","desc":true}}
Transform › Lines › Sort Lines › Sort Naturally Ascending{"SortLines":{"kind":"Natural","desc":false}}
Transform › Lines › Sort Lines › Sort Naturally Descending{"SortLines":{"kind":"Natural","desc":true}}
Transform › Lines › Reverse Line OrderReverseLines
Transform › Lines › Remove Duplicate LinesRemoveDuplicateLines
Transform › Lines › Remove Consecutive Duplicate LinesRemoveConsecutiveDuplicates
Transform › Lines › Remove Empty Lines{"RemoveEmptyLines":{"blank":false}}
Transform › Lines › Remove Empty Lines (Including Blank Ones){"RemoveEmptyLines":{"blank":true}}
Transform › Lines › Trim › Trim Leading and Trailing Space{"Trim":"Both"}
Transform › Lines › Trim › Trim Trailing Space{"Trim":"Trailing"}
Transform › Lines › Trim › Trim Leading Space{"Trim":"Leading"}
Transform › Lines › EOL to SpaceEolToSpace
Transform › Lines › Add Prefix and Suffix…{"TransformDialog":"AffixLines"}
Transform › Lines › Number Lines…{"TransformDialog":"NumberLines"}
Transform › Lines › Reflow Paragraphs…{"TransformDialog":"Reflow"}
Transform › Lines › Tabs to SpacesTabsToSpaces
Transform › Lines › Leading Spaces to Tabs{"SpacesToTabs":{"all":false}}
Transform › Lines › All Spaces to Tabs{"SpacesToTabs":{"all":true}}
Transform › Columns and Fields › Extract Matches…{"TransformDialog":{"Field":"Extract"}}
Transform › Columns and Fields › Align Columns…{"TransformDialog":{"Field":"Align"}}
Transform › Columns and Fields › Select Fields…{"TransformDialog":{"Field":"Select"}}
Transform › Columns and Fields › Sort Lines by Field…{"TransformDialog":{"Field":"SortBy"}}
Transform › Columns and Fields › Split Lines At…{"TransformDialog":{"Field":"Split"}}
Transform › Columns and Fields › Join Lines With…{"TransformDialog":{"Field":"Join"}}
Transform › Columns and Fields › Escape String › JSON / JavaScript{"Transform":{"Field":{"op":"escape_string","language":"json"}}}
Transform › Columns and Fields › Escape String › C / Java / C#{"Transform":{"Field":{"op":"escape_string","language":"c"}}}
Transform › Columns and Fields › Escape String › SQL{"Transform":{"Field":{"op":"escape_string","language":"sql"}}}
Transform › Columns and Fields › Escape String › Regex{"Transform":{"Field":{"op":"escape_string","language":"regex"}}}
Transform › Columns and Fields › Escape String › Shell{"Transform":{"Field":{"op":"escape_string","language":"shell"}}}
Transform › Columns and Fields › Escape String › CSV{"Transform":{"Field":{"op":"escape_string","language":"csv"}}}
Transform › Columns and Fields › Unescape String › JSON / JavaScript{"Transform":{"Field":{"op":"unescape_string","language":"json"}}}
Transform › Columns and Fields › Unescape String › C / Java / C#{"Transform":{"Field":{"op":"unescape_string","language":"c"}}}
Transform › Columns and Fields › Unescape String › SQL{"Transform":{"Field":{"op":"unescape_string","language":"sql"}}}
Transform › Columns and Fields › Unescape String › Regex{"Transform":{"Field":{"op":"unescape_string","language":"regex"}}}
Transform › Columns and Fields › Unescape String › Shell{"Transform":{"Field":{"op":"unescape_string","language":"shell"}}}
Transform › Columns and Fields › Unescape String › CSV{"Transform":{"Field":{"op":"unescape_string","language":"csv"}}}
Transform › Columns and Fields › Unix Time › Unix Time to Date (UTC){"Transform":{"Field":{"op":"unix_time_to_date","utc":true}}}
Transform › Columns and Fields › Unix Time › Unix Time to Date (Local Time){"Transform":{"Field":{"op":"unix_time_to_date","utc":false}}}
Transform › Columns and Fields › Unix Time › Date to Unix Time (Seconds){"Transform":{"Field":{"op":"date_to_unix_time","millis":false}}}
Transform › Columns and Fields › Unix Time › Date to Unix Time (Milliseconds){"Transform":{"Field":{"op":"date_to_unix_time","millis":true}}}
Transform › Convert Case To › UPPERCASE{"ConvertCase":"Upper"}
Transform › Convert Case To › lowercase{"ConvertCase":"Lower"}
Transform › Convert Case To › Title Case{"ConvertCase":"Title"}
Transform › Convert Case To › Sentence case{"ConvertCase":"Sentence"}
Transform › Convert Case To › iNVERT cASE{"ConvertCase":"Invert"}
Transform › Convert Case To › camelCase{"ConvertCase":"Camel"}
Transform › Convert Case To › PascalCase{"ConvertCase":"Pascal"}
Transform › Convert Case To › snake_case{"ConvertCase":"Snake"}
Transform › Convert Case To › kebab-case{"ConvertCase":"Kebab"}
Transform › Convert Case To › CONSTANT_CASE{"ConvertCase":"Constant"}
Transform › Convert to › JSON{"Transform":{"ConvertTo":{"to":"Json","from":null}}}
Transform › Convert to › YAML{"Transform":{"ConvertTo":{"to":"Yaml","from":null}}}
Transform › Convert to › TOML{"Transform":{"ConvertTo":{"to":"Toml","from":null}}}
Transform › Convert to › XML{"Transform":{"ConvertTo":{"to":"Xml","from":null}}}
Transform › Convert to › CSV{"Transform":{"ConvertTo":{"to":"Csv","from":null}}}
Transform › Convert to › Markdown table{"Transform":{"ConvertTo":{"to":"Markdown","from":null}}}
Transform › Encode and Hash › Base64 Encode{"Mime":"Base64Encode"}
Transform › Encode and Hash › Base64 Encode with Line Breaks{"Mime":"Base64EncodeWrapped"}
Transform › Encode and Hash › Base64 Encode, URL-Safe{"Mime":"Base64UrlEncode"}
Transform › Encode and Hash › Base64 Decode{"Mime":"Base64Decode"}
Transform › Encode and Hash › URL Encode (Part of a URL){"Mime":"UrlEncodeComponent"}
Transform › Encode and Hash › URL Encode (Whole URL){"Mime":"UrlEncode"}
Transform › Encode and Hash › URL Decode{"Mime":"UrlDecode"}
Transform › Encode and Hash › Quoted-Printable Encode{"Mime":"QpEncode"}
Transform › Encode and Hash › Quoted-Printable Decode{"Mime":"QpDecode"}
Transform › Encode and Hash › HTML Encode{"Mime":"HtmlEncode"}
Transform › Encode and Hash › HTML Encode, Including Accents and Symbols{"Mime":"HtmlEncodeAll"}
Transform › Encode and Hash › HTML Decode{"Mime":"HtmlDecode"}
Transform › Encode and Hash › SAML Decode{"Mime":"SamlDecode"}
Transform › Encode and Hash › Text to Hex{"Transform":"HexEncode"}
Transform › Encode and Hash › Hex to Text{"Transform":"HexDecode"}
Transform › Encode and Hash › Decode JWT{"Transform":"JwtDecode"}
Transform › Encode and Hash › Hash › MD5{"Transform":{"Hash":"Md5"}}
Transform › Encode and Hash › Hash › SHA-1{"Transform":{"Hash":"Sha1"}}
Transform › Encode and Hash › Hash › SHA-256{"Transform":{"Hash":"Sha256"}}
Transform › Encode and Hash › Hash › SHA-512{"Transform":{"Hash":"Sha512"}}
Transform › Encode and Hash › Hash › CRC32{"Transform":{"Hash":"Crc32"}}
Transform › JSON and XML › Format JSON{"Json":"Format"}
Transform › JSON and XML › Minify JSON{"Json":"Minify"}
Transform › JSON and XML › Sort JSON Keys{"Json":"SortKeys"}
Transform › JSON and XML › Format XML{"Xml":"PrettyPrint"}
Transform › JSON and XML › Format XML, Attributes on New Lines{"Xml":"PrettyPrintAttributes"}
Transform › JSON and XML › Linearize{"Xml":"Linearize"}
Transform › JSON and XML › Escape Special Characters{"Xml":"Escape"}
Transform › JSON and XML › Unescape Special Characters{"Xml":"Unescape"}
Table › Open as Table…{"Table":"OpenAsTable"}
Table › Show as Table{"Table":"ShowAsTable"}
Table › Import Options…{"Table":"ImportOptions"}
Table › Refresh{"Table":"Refresh"}
Table › Columns › Rename Column…{"Table":"RenameColumn"}
Table › Columns › Change Type…{"Table":"ChangeType"}
Table › Columns › Choose Columns…{"Table":"ChooseColumns"}
Table › Columns › Duplicate Column…{"Table":"DuplicateColumn"}
Table › Columns › Flatten Objects{"Table":"Flatten"}
Table › Columns › Move Column Left{"Table":"MoveLeft"}
Table › Columns › Move Column Right{"Table":"MoveRight"}
Table › Columns › Remove Column{"Table":"RemoveColumn"}
Table › Values › Replace Values…{"Table":"ReplaceValues"}
Table › Values › Trim spaces{"Table":{"Text":"trim"}}
Table › Values › Collapse spaces{"Table":{"Text":"collapse_spaces"}}
Table › Values › UPPER CASE{"Table":{"Text":"upper"}}
Table › Values › lower case{"Table":{"Text":"lower"}}
Table › Values › Title Case{"Table":{"Text":"title"}}
Table › Rows › Filter Rows…{"Table":"Filter"}
Table › Rows › Sort Ascending{"Table":"SortAscending"}
Table › Rows › Sort Descending{"Table":"SortDescending"}
Table › Rows › Sort…{"Table":"Sort"}
Table › Rows › Explode into Rows…{"Table":"Explode"}
Table › Rows › Remove Duplicates…{"Table":"RemoveDuplicates"}
Table › Rows › Remove Empty Rows{"Table":"RemoveEmptyRows"}
Table › Rows › Remove Row{"Table":"RemoveRow"}
Table › Edit Cell{"Table":"EditCell"}
Table › Column Statistics{"Table":"ColumnStats"}
Table › Export…{"Table":"Export"}
Table › Save as Recipe…{"Table":"SaveAsRecipe"}
Tools › CsvQuery › CsvQuery PanelToggleCsvQuery
Tools › CsvQuery › Run QueryRunCsvQuery
Tools › CsvQuery › Copy ResultsCopyCsvResults
Tools › CsvQuery › Results to New TabCsvResultsToNewTab
Tools › JSON TreeToggleJsonTree
Tools › Validate JSON{"Json":"Validate"}
Tools › XPath PanelToggleXPathPanel
Tools › Copy Current XPathCopyXPath
Tools › Check XML Syntax{"Xml":"CheckSyntax"}
Tools › Validate XML{"Xml":"ValidateSchema"}
Tools › Validate XML Against…{"Xml":"ChooseSchema"}
Tools › XSL Transform…{"Xml":"XslTransform"}
Tools › Check Syntax When SavingToggleXmlCheckOnSave
Tools › Close Tags AutomaticallyToggleCloseTags

Files, folders and the command line

The settings folder

Ettin Edit keeps everything it remembers in one folder:

  • Linux: ~/.config/EttinEdit (or $XDG_CONFIG_HOME/EttinEdit if you set XDG_CONFIG_HOME)
  • Windows: %APPDATA%\EttinEdit, usually C:\Users\<you>\AppData\Roaming\EttinEdit
In itWhat it holds
settings.jsonYour preferences, recent files, saved macros, changed shortcuts, the schemas picked for XML files, and the recipes allowed to run commands without asking
toolbar.jsonYour toolbar layout, once you've changed it
session.jsonThe tabs that were open, with their carets, encodings and split view
backup/Backups of unsaved changes, so they survive a crash
recipes/Your recipes, one .json file each
themes/Every theme as a .tmTheme file (Themes). .builtin-themes.json tracks which built-in themes you haven't edited.
languages/Your own languages (Languages)
api/Your own completion lists (Languages)
translations/Your own translations, one .ftl file per language, and an English copy to start from (Translations)
plugins/Your plugins, one folder each (Using plugins). .sdk/ holds the plugin SDKs, kept up to date by Ettin Edit.
instance.jsonHow a second Ettin Edit finds the running one
backups/Copies of the files that Import Settings… replaced, one folder per import

Settings > Open Settings Folder opens this folder. The Open … Folder commands in the Theme, Language, Plugins and Transform > Recipes menus, and Open Translations Folder in Preferences, open the folders in it for you, creating them if needed.

You can edit settings.json, themes, languages, translations and recipes while Ettin Edit runs: it reloads a file within a second of you saving it. See Where settings are kept.

Backing up or moving your settings

Settings > Export Settings… puts your settings, shortcuts, toolbar, themes, recipes and languages in one file, and Import Settings… reads it on another computer. See Moving your settings to another computer.

To copy everything, plugins and sessions included, close Ettin Edit and copy the whole folder. To start afresh, close Ettin Edit and rename the folder; Ettin Edit makes a new one with the defaults next time it starts.

The command line

ettin-edit [--multi-instance] [file ...]
ettin-edit --recipe NAME [--allow-commands] [--in-place] [--out FILE] [file ...]
ettin-edit --list-recipes
  • Each file opens in a tab. A file that can't be opened, for example because it doesn't exist, is reported and skipped.

  • If Ettin Edit is already running, the files open in its window, which comes to the front (unless Settings > Single Window is off).

  • --multi-instance (or -multiInst, as in Notepad++) always starts a new window.

  • --recipe runs a recipe on the files (or standard input) without opening a window; --out writes the result to a file, and --list-recipes lists your recipes.

  • A workbook (.xlsx, .ods and so on) opens as a table.

On Windows, the installer can add Ettin Edit to the PATH so this works in any terminal. On Linux the packages put ettin-edit on the PATH.

Plugins' environment

Plugins run as separate programs. They get the ETTIN_VERSION environment variable with Ettin Edit's version; see Writing plugins.

Troubleshooting and FAQ

Ettin Edit won't start on Linux

Run ettin-edit in a terminal to see the error. The usual cause is a missing desktop library when using the .tar.gz: install OpenGL and, on X11, libxkbcommon-x11 (sudo apt install libxkbcommon-x11-0 libgl1 on Debian and Ubuntu). The .deb, .rpm, Arch and Flatpak packages install these for you; the .tar.gz and AppImage use the ones on your system.

The software centre says "No software repository included" or "Unknown licence"

You opened the downloaded .deb file in GNOME Software (the Software app on Zorin OS and many Ubuntu-based systems). That page only reads the package's basic fields, so it says this for every .deb, even though Ettin Edit's has the licence, release notes and update repository. Install it anyway: the details show once it's installed, and updates arrive through your software updater. For the full page before installing, use the Flatpak, or add the Ettin Edit repository first. See Why a downloaded .deb shows "Unknown licence".

A .deb from before 1.4.0 really had no package information: install the latest one once.

The title bar looks different from other apps

On Linux the title bar (the strip with the window title and the minimise, maximise and close buttons) is drawn by your desktop where it can be:

  • KDE Plasma, Xfce, Cinnamon, MATE, Sway, Hyprland, any X11 session, and Windows: the desktop draws it, so it matches your other apps and your window decoration theme.
  • GNOME on Wayland (and some other Wayland desktops, such as Weston): GNOME leaves the title bar to each app. Since 2.8.2 Ettin Edit draws a GNOME-style one, light or dark to follow Settings > Appearance in GNOME, with the buttons in the order GNOME is set to.

Versions before 2.8.2 showed a plain grey strip with square buttons there. Update to get the GNOME-style title bar.

If you'd rather have your desktop draw it on GNOME, start Ettin Edit as an X11 app with WAYLAND_DISPLAY= ettin-edit; GNOME then draws the title bar, though text can look slightly blurry on a scaled display.

A file opened in the running window instead of a new one

That's the Single Window setting. Turn it off in the Settings menu, or start Ettin Edit with --multi-instance, to get separate windows. See One window or several.

The text looks garbled: é instead of é

Ettin Edit guessed the wrong encoding. Choose Encoding > Reopen With and pick the right one; for files from older Windows programs it's usually Windows-1252. See Encodings.

Saving says a character can't be saved

The file's encoding can't hold that character (for example € in ISO-8859-1). Choose Encoding > UTF-8 and save again, or remove the character. Nothing is lost while you decide.

Text in another script shows as boxes

Ettin Edit draws scripts its own fonts don't cover (Chinese, Japanese, Korean, Bangla, Hindi, Tamil, Thai and others) with a font from your system. Boxes mean no installed font covers that script. Install one and restart Ettin Edit:

  • Arch, CachyOS: noto-fonts (most scripts) and noto-fonts-cjk.
  • Debian, Ubuntu: fonts-noto-core and fonts-noto-cjk.
  • Fedora: google-noto-sans-bengali-fonts and the like, one per script, or google-noto-sans-cjk-fonts.
  • Windows: the fonts come with Windows. If a script is missing, add its language under Settings > Time & language > Language & region, which also installs its font.

Arabic and Hebrew show their letters but left to right, because Ettin Edit doesn't lay out right-to-left text yet.

A shortcut doesn't work

  • Open the command palette (F1) and find the command: it shows the shortcut actually in use.
  • Check the Shortcut Mapper for a clash with another command or a plugin.
  • Your desktop may be using the keys itself. GNOME, KDE and Windows all reserve a few Ctrl+Alt combinations. Pick another shortcut for the command.

A plugin doesn't run

  1. Open Plugins > Manage Plugins… and look under the plugin's name for the reason.
  2. Check Plugins > Plugin Log for errors.
  3. Make sure Python 3 or Node.js is installed, or set its path in Preferences > Plugins.
  4. If you chose Don't Allow earlier, turn the plugin back on in Manage Plugins.

The update check says it couldn't reach GitHub

Ettin Edit needs to reach api.github.com to check for updates, and github.com to download them. Behind a proxy or firewall that blocks it, check the releases page in your browser instead, and turn off Help > Check for Updates Automatically.

Update Now says the install failed

  • "needs an administrator password, and none was given": the password prompt was closed. Click Try Again.
  • pacman says it couldn't lock the database: another package manager is running (a system update, perhaps). Let it finish, then Try Again.
  • "didn't match its checksum": the download was damaged or changed on the way. Try again later, or download the file from the release page.
  • Can't write to the folder: a .tar.gz or .zip copy unpacked somewhere only an administrator can change (such as /opt) can't replace itself. Download the new version from the release page, or move Ettin Edit to a folder of your own.

The scroll bar settles after resizing a huge file

With word wrap on, resizing the window wraps the lines you can see straight away and the rest of the file in the background, so the window never freezes. In a file with hundreds of thousands of long lines that takes a second or two, and until it finishes the scroll bar's size and the document map can shift a little. The text at the top of the view stays where it is.

I edited settings.json by hand

You can do that while Ettin Edit runs: when you save the file, Ettin Edit reads it again within a second and uses the new settings. If the file has a mistake (a missing comma, say), the settings you had stay in use and a message names the line and column, with an Open button that takes you there. Fix it and save again. The same goes for themes, languages, translations and recipes.

Ettin Edit doesn't write its own copy over a settings.json you've just changed: it reads your version first.

I imported settings and want my old ones back

Import Settings… copies each file it replaces to a folder named after the date and time under backups in the settings folder (Settings > Open Settings Folder). Close Ettin Edit, copy the files from there back to the settings folder, and start it again.

I closed a file without saving

If Remember Unsaved Changes on Exit is on (the default), quitting never throws changes away. Closing a single tab does ask first, though, and Don't Save really doesn't save. If the file was saved at some point, your file manager's trash or your backups may still have an older copy.

Where do I report a bug or ask for a feature?

On the issues page. Say which version you have (Help > About Ettin Edit) and which system you use, and attach the plugin log if a plugin is involved.

Is Ettin Edit Notepad++?

No. It's inspired by Notepad++ and shares none of its code; every line was written for Ettin Edit. It's free and open source under the MIT licence.

Who gets the spoon?

Still being decided. Please don't open an issue about it.