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 you | The editor |
|---|---|
Type (, [, { or a quote | Types 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 one | Moves over it instead of typing a second one. |
| Type a bracket or quote with text selected | Wraps the selection in the pair. |
| Press Enter | Starts 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 spaces | Deletes back to the previous tab stop. |
| Press Tab | Indents 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
| Key | Does |
|---|---|
| Ctrl← and Ctrl→ | Move by words. Add Shift to select. |
| Home | Moves to the first character of the line that is not indentation, then to the start of the line. |
| CtrlHome and CtrlEnd | Move to the start and end of the file. |
| Ctrl↑ and Ctrl↓ | Scroll by a line without moving the caret. |
| CtrlBackspace and CtrlDelete | Delete to the previous or next word boundary. |
| Alt↑ and Alt↓ | Move the selected lines up or down. |
| ShiftAlt↓ | Copies the selected lines below themselves. |
| CtrlShiftK | Deletes the selected lines. |
| CtrlA | Selects everything. |
| Escape | Clears 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:
| Action | Does |
|---|---|
| Double-click | Selects a word. |
| Triple-click | Selects a line. |
| Click a line number | Selects the line; drag to select more lines. |
| Click the light bulb in the gutter | Shows the quick fixes and refactorings for the line. See Quick fixes and refactorings. |
| Shift+click | Extends the selection to the click. |
| Drag past the top or bottom | Scrolls while selecting. |
| Ctrl+click | Goes to the definition of the symbol. While you hold Ctrl, the word under the pointer is underlined. |
| Ctrl+wheel | Makes the text bigger or smaller. |
| Shift+wheel | Scrolls 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.
| Key | Does |
|---|---|
| Enter or F3 | Goes to the next match. |
| ShiftEnter or ShiftF3 | Goes to the previous match. |
| AltC | Matches case. |
| AltW | Matches whole words only. |
| AltR | Treats the query as a regular expression. |
| Enter in the replace box | Replaces the current match and goes to the next. |
| CtrlAltEnter | Replaces every match, as one undo step. |
| Escape | Closes 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.
| Command | Keys |
|---|---|
| Next Change | F7 |
| Previous Change | ShiftF7 |
| Rollback Lines, for the changes in the selected lines | CtrlAltZ |
| 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.