Text & Code Editor

A full text/code editing verb set operating on real file content. The document is never fragmented into separate line objects — content stays a single intact string, and line/column positions are always computed offsets. Cursor and selection are held as their own values, separate from the document, so they can be computed once and reused across multiple operations.

Creating, Opening and Saving

Open, save, detect language
EDITOR OPEN "/root/script.py" SET ?doc
AFTER EDITOR ?doc SAVE SET ?ok
AFTER EDITOR ?doc SAVE INTO "/root/script_copy.py" SET ?ok
AFTER EDITOR ?doc LANG SET ?lang

EDITOR OPEN loads a file that already exists. NEW EDITOR starts a document that has no file behind it yet — the whole verb set below works on it identically, and SAVE INTO is what first commits it to disk. AS sets the language up front, the same value EDITOR ?doc LANG reads back.

Start an empty document, write it, save it
NEW EDITOR SET ?doc
AFTER EDITOR ?doc GOTO LINE 1 COL 1 SET ?pos
AFTER EDITOR ?doc INSERT AT ?pos WITH "print('hello')" SET ?doc
AFTER EDITOR ?doc SAVE INTO "/root/new_script.py" SET ?ok
Declare the language up front
NEW EDITOR AS "python" SET ?doc
AFTER EDITOR ?doc LANG SET ?lang
AFTER EMIT ?lang
(* Output: python — with no file on disk to infer it from *)
SAVE needs a path first. A document from NEW EDITOR has no source file, so SAVE alone has nowhere to write. Use SAVE INTO "path" for the first write; after that, SAVE writes back to that path like any opened document.

Cursor & Position

GOTO computes a position — it does not mutate the document. The resulting ?pos can be reused by any operation that accepts a position.

Move to a position
EDITOR OPEN "/root/notes.txt" SET ?doc
AFTER EDITOR ?doc GOTO LINE 5 COL 3 SET ?pos

Selection

SELECT computes a selection range — also standalone, not a document mutation. Selection-based operations act on whatever ?sel was passed.

Select a range, a line, everything, or a rectangular block
EDITOR OPEN "/root/notes.txt" SET ?doc
AFTER EDITOR ?doc SELECT FROM LINE 2 COL 1 TO LINE 4 COL 10 SET ?sel
AFTER EDITOR ?doc SELECT LINE 5 SET ?sel2
AFTER EDITOR ?doc SELECT ALL SET ?sel3
AFTER EDITOR ?doc SELECT BLOCK FROM LINE 2 COL 3 TO LINE 6 COL 3 SET ?sel4
Act on a selection
EDITOR OPEN "/root/notes.txt" SET ?doc
AFTER EDITOR ?doc SELECT FROM LINE 2 COL 1 TO LINE 4 COL 10 SET ?sel
AFTER EDITOR ?doc SELECTION ?sel COPY SET ?clip
AFTER EDITOR ?doc SELECTION ?sel DELETE SET ?doc
AFTER EDITOR ?doc SELECTION ?sel REPLACE WITH "new text" SET ?doc
AFTER EDITOR ?doc SELECTION ?sel INDENT SET ?doc
AFTER EDITOR ?doc SELECTION ?sel OUTDENT SET ?doc
AFTER EDITOR ?doc SELECTION ?sel UPPERCASE SET ?doc
AFTER EDITOR ?doc SELECTION ?sel LOWERCASE SET ?doc

Copy, Cut, Paste

Clipboard flow
EDITOR OPEN "/root/notes.txt" SET ?doc
AFTER EDITOR ?doc SELECT LINE 5 SET ?sel
AFTER EDITOR ?doc SELECTION ?sel CUT SET ?doc
AFTER EDITOR ?doc GOTO LINE 10 COL 1 SET ?pos
AFTER EDITOR ?doc PASTE AT ?pos SET ?doc

Insert, Delete, Replace at a Position

Insert and delete single characters at a position
EDITOR OPEN "/root/notes.txt" SET ?doc
AFTER EDITOR ?doc GOTO LINE 3 COL 1 SET ?pos
AFTER EDITOR ?doc INSERT AT ?pos WITH "New line content" SET ?doc
AFTER EDITOR ?doc DELETE AT ?pos SET ?doc
AFTER EDITOR ?doc BACKSPACE AT ?pos SET ?doc
Replace or delete whole lines and ranges
EDITOR OPEN "/root/notes.txt" SET ?doc
AFTER EDITOR ?doc REPLACE LINE 5 WITH "replacement text" SET ?doc
AFTER EDITOR ?doc REPLACE FROM LINE 2 COL 5 TO LINE 2 COL 8 WITH "text" SET ?doc
AFTER EDITOR ?doc DELETE LINE 5 SET ?doc
AFTER EDITOR ?doc DELETE FROM LINE 2 TO LINE 4 SET ?doc

Extracting Content

Read a line, a range, or a rectangular block without modifying the document
EDITOR OPEN "/root/notes.txt" SET ?doc
AFTER EDITOR ?doc EXTRACT LINE 5 SET ?text
AFTER EDITOR ?doc EXTRACT FROM LINE 2 COL 1 TO LINE 4 COL 10 SET ?text2
AFTER EDITOR ?doc EXTRACT BLOCK FROM LINE 2 COL 3 TO LINE 6 COL 3 SET ?text3

Find & Replace

Plain-text find and replace
EDITOR OPEN "/root/app.js" SET ?doc
AFTER EDITOR ?doc FIND WITH "TODO" SET ?matches
AFTER EDITOR ?doc REPLACE ALL "var " WITH "let " SET ?doc
AFTER EDITOR ?doc REPLACE FIRST "TODO" WITH "DONE" SET ?doc
Regex find and replace
EDITOR OPEN "/root/app.js" SET ?doc
AFTER EDITOR ?doc FIND REGEX WITH "function\\s+\\w+" SET ?matches
AFTER EDITOR ?doc REPLACE ALL REGEX "[0-9]+" WITH "NUM" SET ?doc
AFTER EDITOR ?doc REPLACE FIRST REGEX "^\\s+" WITH "" SET ?doc

Line Operations

Duplicate, move, join, indent
EDITOR OPEN "/root/app.js" SET ?doc
AFTER EDITOR ?doc DUPLICATE LINE 5 SET ?doc
AFTER EDITOR ?doc MOVE LINE 5 UP SET ?doc
AFTER EDITOR ?doc MOVE LINE 6 DOWN SET ?doc
AFTER EDITOR ?doc JOIN LINE 5 SET ?doc
AFTER EDITOR ?doc INDENT LINE 5 SET ?doc
AFTER EDITOR ?doc OUTDENT LINE 5 SET ?doc
Sort and deduplicate lines
EDITOR OPEN "/root/list.txt" SET ?doc
AFTER EDITOR ?doc SORT LINES SET ?doc
AFTER EDITOR ?doc DEDUPLICATE LINES SET ?doc

Whitespace, Line Endings, Encoding

Normalize formatting
EDITOR OPEN "/root/file.txt" SET ?doc
AFTER EDITOR ?doc TRIM TRAILING WHITESPACE SET ?doc
AFTER EDITOR ?doc CONVERT LINE ENDINGS TO "LF" SET ?doc
AFTER EDITOR ?doc CONVERT TABS TO SPACES SET ?doc
AFTER EDITOR ?doc CONVERT SPACES TO TABS SET ?doc
AFTER EDITOR ?doc CONVERT ENCODING TO "UTF-8" SET ?doc

Bookmarks

Mark, remove, and list bookmarked lines
EDITOR OPEN "/root/notes.txt" SET ?doc
AFTER EDITOR ?doc BOOKMARK LINE 5 SET ?doc
AFTER EDITOR ?doc BOOKMARK REMOVE LINE 5 SET ?doc
AFTER EDITOR ?doc BOOKMARKS SET ?lines

Counting

Lines, words, characters
EDITOR OPEN "/root/file.txt" SET ?doc
AFTER EDITOR ?doc COUNT LINES SET ?n
AFTER EDITOR ?doc COUNT WORDS SET ?n2
AFTER EDITOR ?doc COUNT CHARS SET ?n3

Not in scope

Syntax highlighting, autocomplete, word-wrap, and minimap are live rendering behaviors of an interactive editor UI, not text transformations — there is no server-side operation that produces them, since they describe how content is displayed, not what the content is. These remain the responsibility of whatever renders the editor's output.