- Rebol 100%
| .claude | ||
| docs | ||
| examples | ||
| plugins | ||
| tests | ||
| .gitignore | ||
| AGENTS.md | ||
| completion.r3 | ||
| options.example.reb | ||
| README.md | ||
| rebol-analysis.r3 | ||
| rebol-key-dispatch.r3 | ||
| rebol-search.r3 | ||
| rebol-syntax.r3 | ||
| rebol-terminal.r3 | ||
| rebol-text.r3 | ||
| text-edit.r3 | ||
| tui.r3 | ||
| ve.r3 | ||
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.
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) — seedocs/rebol-syntax.md.rebol-analysis.r3: literal-only semantic evaluator and token-to-row indexing — seedocs/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
hjkl: 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.nandN: 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.nandp: switch to next or previous buffer.- Escape: cancel leader mode.
Select mode:
- Arrow keys or
hjkl: 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/.
