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

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

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.
  • 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.

Spaces and tabs

Edit > Blank Operations work on the selected lines, or the whole document:

  • Trim Trailing Space, Trim Leading Space, or both.
  • EOL to Space joins the lines with a space between them.
  • Tabs to Spaces, Leading Spaces to Tabs and All Spaces to Tabs, using the tab width from Preferences.

Case

Edit > Convert Case To:

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

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 > XML 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.