Skip to main content

The editor

The editor highlights code by its language, closes brackets and keeps indentation as you type, and shows completion, hover and problems from the language's server. This page covers typing, selecting, finding and replacing, and how files are read and saved.

Typing aids​

When youThe editor
Type (, [, { or a quoteTypes the closing one too, when the next character is a space, the end of the line or a closing bracket. A quote right after a letter or digit is typed alone.
Type a closing bracket or quote right before the same oneMoves over it instead of typing a second one.
Type a bracket or quote with text selectedWraps the selection in the pair.
Press EnterStarts the new line with the same indentation. After an opening bracket it indents one level more; between { and } it puts the } on a line of its own.
Press Backspace between an empty pair, such as ()Deletes both.
Press Backspace in indentation made of spacesDeletes back to the previous tab stop.
Press TabIndents the selected lines, or moves the caret to the next tab stop. ShiftTab removes one level from the selected lines.
Press Ctrl/Comments the selected lines out with the language's line comment, or back in.

The settings Close brackets and quotes, Tab size and Insert spaces change these. Typing groups into one undo step until you pause, type a space or move the caret.

Move and select​

KeyDoes
Ctrl← and Ctrl→Move by words. Add Shift to select.
HomeMoves to the first character of the line that is not indentation, then to the start of the line.
CtrlHome and CtrlEndMove to the start and end of the file.
Ctrl↑ and Ctrl↓Scroll by a line without moving the caret.
CtrlBackspace and CtrlDeleteDelete to the previous or next word boundary.
Alt↑ and Alt↓Move the selected lines up or down.
ShiftAlt↓Copies the selected lines below themselves.
CtrlShiftKDeletes the selected lines.
CtrlASelects everything.
EscapeClears the selection.

On macOS, Cmd takes the place of Ctrl for the clipboard, undo and select all, and Option moves by words.

With the mouse:

ActionDoes
Double-clickSelects a word.
Triple-clickSelects a line.
Click a line numberSelects the line; drag to select more lines.
Click the light bulb in the gutterShows the quick fixes and refactorings for the line. See Quick fixes and refactorings.
Shift+clickExtends the selection to the click.
Drag past the top or bottomScrolls while selecting.
Ctrl+clickGoes to the definition of the symbol. While you hold Ctrl, the word under the pointer is underlined.
Ctrl+wheelMakes the text bigger or smaller.
Shift+wheelScrolls sideways.

Copy, cut and paste​

With nothing selected, CtrlC copies the whole line and CtrlX cuts it. Pasting a line copied that way puts it above the caret's line, so copying a line and pasting it repeats the line. Copied text uses the file's line endings.

Find and replace​

CtrlF opens the find bar at the top right of the editor; CtrlH opens it with the replace row. When text on one line is selected, it becomes the query. Every match is highlighted, and the bar counts them, such as 3 of 12.

KeyDoes
Enter or F3Goes to the next match.
ShiftEnter or ShiftF3Goes to the previous match.
AltCMatches case.
AltWMatches whole words only.
AltRTreats the query as a regular expression.
Enter in the replace boxReplaces the current match and goes to the next.
CtrlAltEnterReplaces every match, as one undo step.
EscapeCloses the bar.

With a regular expression, the replacement can refer to groups, such as $1, and \n and \t insert a line break and a tab. The bar highlights up to 10,000 matches.

To search every file of the folder, use Find in Files.

Go to a line​

CtrlG opens the command palette with :. Type a line number, or a line and a column such as 42:7, and press Enter. Clicking the caret position in the status bar does the same.

Zoom​

Ctrl= and Ctrl-, or Ctrl+wheel, make the editor's text bigger or smaller, and Ctrl0 resets it. Zooming changes the Font size setting, so every editor follows and the size stays the next time.

Files on disk​

Runesmith reads the file's encoding from its byte order mark, or as UTF-8, or as Latin-1 when it is not valid UTF-8, and saves it the same way. It also keeps the file's line endings, LF or CRLF; click them in the status bar to change them. New files use the Line ending of new files setting.

When you save, the settings Trim trailing whitespace and Insert a final newline can tidy the file; you can undo what they change. Auto save saves changed files a second after you stop typing, or when the editor loses focus.

When a file changes on disk while it is open:

  • If it has no unsaved changes, Runesmith reloads it. You can undo the reload.
  • If it has unsaved changes, a notification says so, and Reload takes the version on disk.
  • If it was deleted, the editor keeps the text and a notification says so; saving creates the file again.

Runesmith does not open files over 50 MB, or files that look binary.

Changes and diffs​

When a plugin knows an earlier version of a file, such as the version control plugin with the last commit, the gutter marks what changed since: a green bar for added lines, a blue bar for changed lines, and a small red triangle where lines were deleted. The marks follow your typing.

Click a mark to see the lines as they were. The popup has Rollback, which puts them back as one step you can undo, arrows to the previous and next change, and Show Diff.

CommandKeys
Next ChangeF7
Previous ChangeShiftF7
Rollback Lines, for the changes in the selected linesCtrlAltZ
Show Changes

The editor's context menu has them too.

Show Changes and Show Diff open the file beside its earlier version in a tab. Changed lines are tinted on both sides, with the changed words stronger; lines only one side has are green or red, with hatched rows on the other side so the two stay aligned as they scroll. The right side is the file itself: edit it there and save as usual. F7 and ShiftF7, or the arrows above the sides, move between the differences.