ve - Values Editor Rebol focused editor operating at values level, not at text level
Find a file
2026-05-31 00:15:12 +02:00
.claude Add file requestor and plugin options 2026-05-31 00:15:12 +02:00
docs Add file requestor and plugin options 2026-05-31 00:15:12 +02:00
examples Use shared TUI helper modules 2026-05-23 16:17:55 +02:00
plugins Add file requestor and plugin options 2026-05-31 00:15:12 +02:00
tests Add file requestor and plugin options 2026-05-31 00:15:12 +02:00
.gitignore Add file requestor and plugin options 2026-05-31 00:15:12 +02:00
AGENTS.md Use shared TUI helper modules 2026-05-23 16:17:55 +02:00
completion.r3 FEAT: Completion 2026-05-24 08:25:12 +02:00
options.example.reb Add file requestor and plugin options 2026-05-31 00:15:12 +02:00
README.md Add file requestor and plugin options 2026-05-31 00:15:12 +02:00
rebol-analysis.r3 PERF: restore analysis speed after function-recognition feature 2026-05-23 19:08:51 +02:00
rebol-key-dispatch.r3 Use shared TUI helper modules 2026-05-23 16:17:55 +02:00
rebol-search.r3 FIX: by-name module imports so demo can load from examples/ 2026-05-19 22:24:55 +02:00
rebol-syntax.r3
rebol-terminal.r3 Speed up terminal and completion paths 2026-05-28 12:55:42 +02:00
rebol-text.r3 Use shared TUI helper modules 2026-05-23 16:17:55 +02:00
text-edit.r3 Use shared TUI helper modules 2026-05-23 16:17:55 +02:00
tui.r3 Use shared TUI helper modules 2026-05-23 16:17:55 +02:00
ve.r3 Add file requestor and plugin options 2026-05-31 00:15:12 +02:00

VE

ve.r3 is a small modal terminal editor for Rebol source files.

It edits one or more files, highlights Rebol tokens, shows diagnostics and cursor information in a side panel, and lets you navigate analyzed value tokens. The analysis pass uses transcode plus literal-only evaluation helpers; it does not do the source being edited.

Screenshot #1

Files

  • ve.r3: editor implementation.
  • tui.r3, rebol-text.r3, rebol-key-dispatch.r3, text-edit.r3: compatibility shims for the shared modules in ../tui.
  • rebol-syntax.r3: pure syntax classification (predicates, token-category, category-style, token helpers) — see docs/rebol-syntax.md.
  • rebol-analysis.r3: literal-only semantic evaluator and token-to-row indexing — see docs/rebol-analysis.md.
  • tests/: offline regression tests copied from the original project.

Run

Open one file:

r3 -s ve.r3 path/to/file.r3

Open multiple files:

r3 -s ve.r3 first.r3 second.r3

From Rebol code:

do %ve.r3
ve %path/to/file.r3

Controls

Normal mode:

  • Arrow keys or h j k l: move the cursor.
  • PageUp/PageDown: move by one edit viewport.
  • i: enter insert mode at the cursor.
  • a: enter insert mode after the cursor.
  • o: open a new line below and enter insert mode.
  • s: start selection at the current character.
  • Enter: execute the current expression in the integrated terminal.
  • t: focus the integrated terminal.
  • p: paste the internal register at the cursor.
  • x: delete the character at the cursor.
  • /: search the current buffer.
  • n and N: repeat the previous search forward or backward.
  • g d: search for the current word's definition.
  • ] and [: move to next or previous value token.
  • } and {: skip to next or previous sibling value.
  • e: move to the enclosing value.
  • u: undo the last edit.
  • r: redo the last undone edit.
  • Space: enter leader mode.

Leader mode:

  • s: save.
  • q: quit if the current buffer is clean.
  • Q: force quit.
  • w: save and quit.
  • c: refresh analysis.
  • a: ask an optional assistant plugin.
  • o: open local options.
  • d: delete the current line.
  • g: go to line.
  • e: open a file in a new buffer, or switch to it if already open.
  • n and p: switch to next or previous buffer.
  • Escape: cancel leader mode.

Select mode:

  • Arrow keys or h j k l: extend selection.
  • s: expand selection to value, expression, and enclosing series levels.
  • [ and ]: select from the original cursor to semantic starts or ends.
  • Enter: execute the selected code in the integrated terminal.
  • y: copy selection to the internal register.
  • x: cut selection to the internal register.
  • p: replace selection with the internal register.
  • Escape: clear selection and return to normal mode.

Insert mode:

  • Escape: return to normal mode.
  • Tab: insert spaces using the editor tab width.
  • Enter, Backspace, Delete, arrow/PageUp/PageDown keys, and printable text edit the buffer.

Terminal mode:

  • Enter: execute the terminal input in the same session namespace.
  • Backspace/Delete and printable text edit the terminal input.
  • Escape: return to normal mode.

Local Options

VE optionally loads a repo-local options.reb as data with load; it is not executed. The file is ignored by git. Use Space o to create/open it from options.example.reb, then save it to apply changes to the current session.

Supported sections are ui, syntax-styles, and plugins/assistant. Built-in defaults are applied first, then options.reb, then explicit make-session/config overrides.

Optional Assistant Plugin

VE does not load AI code by default. Configure plugins/assistant/path in options.reb, or set VE_ASSISTANT_PLUGIN, to a Rebol file that returns an object or module with ask: function [ctx [map!]] [...], then use Space a to send a prompt. The context map includes prompt, path, row, col, current-line, selection, workspace-root, and assistant-options; the response is appended to the terminal pane.

A Clair/AIR adapter is included at plugins/clair.r3. Enable it with:

VE_CLAIR=1 r3 -s ve.r3 path/to/file.r3

Clair can also be configured under plugins/assistant/clair in options.reb. Environment variables VE_CLAIR_ROOT, VE_CLAIR_AGENT, VE_CLAIR_SERVICE, VE_CLAIR_MODEL, VE_CLAIR_MAX_ROUNDS, and VE_CLAIR_MODE=plan|build override the corresponding local options.

Tests

Run the offline suite:

r3 -s tests/run.r3

The focused test file is:

r3 -s tests/test_rebol_editor_analysis.r3

Test render captures are written under tests/tmp/.