Scoria

Editing a note

Scoria has one editor with two faces. Both are the same buffer and the same parser; they differ in how much of the Markdown they show you.

ModeMarkersSwitch with
Live PreviewHidden, unless the cursor or selection touches the constructeditor:toggle-source
Source modeAll visible, alwayseditor:toggle-source

Ctrl + E (markdown:toggle-preview) switches between editing and reading view. Which editing mode you get is your vault's livePreview setting; which of editing or reading a note opens in is defaultViewMode.

Live Preview

The rule is Obsidian's: a construct renders unless your cursor is in it, and then it shows its source so you can edit it.

  • Headings are scaled by level; the # markers appear when you enter the line.
  • Wikilinks show their alias, or their target when they have no alias. Markdown links show their text.
  • Tasks render as checkboxes, and a click toggles one.
  • Quotes show a bar per level; callouts fold the [!type] into the title.
  • Comments (%%…%%) and block ids (^id) are hidden.
  • Inline math loses its dollar signs (the formula itself is not typeset — see tables, code and math).
  • Emphasis, strong, strike and highlight drop their delimiters.

Block widgets

A top-level table, math block, or a paragraph that is nothing but an embed is rendered in place of its source lines, through the same renderer reading view uses — so an embedded note appears inline while you write around it. The widget shows its source again when your cursor enters the block: with the arrow keys, or by clicking a table or math widget, which puts the cursor at the row you clicked.

Links inside an embed widget are clickable, and follow.

In Live Preview, a click on a rendered link follows it. In Source mode, Ctrl + click does — a plain click puts the cursor there, which is what you want when the markers are showing.

Source mode

Every character of the file, with syntax highlighting and nothing hidden. This is the mode for fixing a mangled table, seeing exactly where a stray %% is, or editing a note whose formatting is itself the subject.

Decorations come from the parser, recomputed on a background thread after each edit — one parse in flight and one queued — and swapped in when ready. Typing never waits for the parser, which is why a very large note still types smoothly. The status bar shows the current parse time and span count.

Soft wrap and the readable line length

Lines wrap at the view width, capped at the readable line length and centred, the way Obsidian does with readableLineLength on.

The scroll position is a line plus a pixel offset into that line, rather than an absolute pixel count. That is what makes a 50,000-line note cheap: wrapped-row heights are only ever measured near the viewport, so no full layout pass is needed to know where you are. Page Up, Page Down, revealing the cursor and clamping at the end of the note all walk rows from that anchor.

Selection and movement

Extend a selectionShift with any movement key, or drag
Select a wordDouble-click
Select a lineTriple-click
Select everythingCtrl + A
Move or delete by wordCtrl + ← / →, Ctrl + Backspace / Delete
Copy, cut, pasteCtrl + C, Ctrl + X, Ctrl + V — cut and copy take the whole line when nothing is selected

Smart lists

With smartIndentList on (the default), pressing Enter continues what the line started:

  • Its quote markers (>, > >).
  • Its bullet, or the next number in an ordered list — and the siblings after it renumber.
  • An empty checkbox, after a task item.

Shift + Enter is always a plain newline, whatever the line started. An empty item is cleared rather than continued; an empty nested item outdents instead. Tab and Shift + Tab indent and outdent list items, using a tab or tabSize spaces depending on useTab, and any ordered items this unsettles renumber: an item follows its previous sibling at its own depth, and one with no previous sibling restarts at 1.

Multiple cursors

To add a cursor
Above or beloweditor:add-cursor-above, editor:add-cursor-below
At every match of a searchFind all — Alt + Enter in the find panel
AnywhereAlt + click (again on an existing cursor removes it)

Typing, deleting, Enter, Tab, cut, copy and paste all apply at every cursor as a single undo step. Copy joins the cursors' selections with newlines; paste gives one line to each cursor when the counts match, and otherwise pastes the whole clipboard at each. Movement moves every cursor, and selections that come to overlap merge. Escape, or a plain click, keeps only the primary cursor.

Undo

Undo and redo group the way CodeMirror's do: consecutive typing, or consecutive deleting, within half a second of itself is one step. A Replace all is one step however many matches it changed, and so is an edit made at twenty cursors at once.

Saving

Scoria saves the note you are editing, and only that note.

Saves on
IdleTwo seconds after your last keystroke
Ctrl + Seditor:save-file
NavigationWhen another note opens
Mode changeWhen you switch to reading view (which then rebuilds from the saved text)
CloseWhen the window closes

What a save writes. The buffer holds \n internally. The file's byte-order mark and its line endings are remembered when it was loaded and restored when it is written, so a note that was CRLF-with-a-BOM is written back CRLF-with-a-BOM, and a save changes nothing but the bytes you actually edited.

When the file changes underneath you. If the note on disk is what Scoria itself last wrote, the watcher's reload is skipped. If the note changed underneath an unedited buffer, it reloads and keeps your cursor. If you have unsaved edits, they are left alone — Scoria will not throw away your typing to take the disk's version.

Not yet

  • Auto-pairing of brackets and Markdown markers (autoPairBrackets, autoPairMarkdown are read but not acted on).
  • Table cell editing. A table renders as a widget in Live Preview, but you edit it as text.
  • Properties editing. Frontmatter is text here, not a property editor.
  • Autocompletion of links, tags and headings as you type [[ or #.
  • Templates, daily notes, file recovery.
  • Vim mode (vimMode is read, not implemented).
  • Ctrl + click page previews, heading folding, indent guides, line numbers.

Next

Source: sites/scoria/content/docs/app/editing.md