Skip to content

About

A portable, keyboard workflow focused Text and Code Editor

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

Visitors Documentation

Royi Text Editor

RoyiTextEditor is a portable, keyboard workflow focused, lightweight and performance oriented Text and Code Editor.

The editor focuses on:

  • Minimalistic and focused UI.
  • High performance to generate reactive experience.
  • Commands through Command Center / Command Palette.
  • Keyboard oriented workflow.
  • Developed and verified on Windows OS.

Development prioritizes correctness and performance.
Each release is validated by hundreds of correctness tests and accompanied by a detailed performance report.

Installation

  1. Open the latest release.
  2. Download RoyiTextEditor-<version>-windows-x86_64.zip.
  3. Extract the ZIP file to a folder of your choice; its top-level folder is RoyiTextEditor (the file name in the application metadata).
  4. Run RoyiTextEditor.exe from the extracted folder.

Tip

RoyiTextEditor is portable. Keep the extracted files together and move the folder whenever needed.

Requirements: Windows 11, x64 CPU with AVX2.

Usage

RoyiTextEditor.exe [--read-only] [--syntax <id>] [--spelling <engine>] [file]

--syntax <id> chooses the highlighting language (for example --syntax json for a .ipynb notebook); --syntax none or --syntax off (any case) turns highlighting off, as does View: Toggle Syntax Highlighting in the palette. An unknown id keeps the language of the file name and shows a notice. --spelling off|builtin|hunspell|windows turns spelling off or on with that engine for the session.

Keys Action
Left / Right, Ctrl+Left / Ctrl+Right Move by character / word
Up / Down, PgUp / PgDn Move by line / page
Home / End First non-blank character or line start / line end
Ctrl+Home / Ctrl+End Start / end of file
Shift with any move Extend the selection
Ctrl+A, Esc Select all, collapse the selection
Backspace / Delete, with Ctrl Delete a character, a word
Enter New line keeping the indentation
Tab / Shift+Tab Insert a tab or indent lines / outdent lines
Ctrl+] / Ctrl+[ Indent / outdent the lines (also for a caret)
Alt+Up / Alt+Down Move the lines up / down
Shift+Alt+Up / Shift+Alt+Down Copy the lines up / down
Ctrl+Shift+K Delete the lines
Ctrl+Enter / Ctrl+Shift+Enter Insert a line below / above
Ctrl+G Go to line: N, N:C (column), -N (from the end)
Insert Toggle overtype
Ctrl+Z, Ctrl+Y / Ctrl+Shift+Z Undo, redo
Ctrl+C / Ctrl+X / Ctrl+V Copy / cut / paste (whole line without a selection)
Ctrl+S Save
Ctrl+K P Copy the full path of the file
Click, double-click, triple-click, Shift+click Place the caret, select a word, a line, extend
Wheel, Ctrl+Up / Ctrl+Down Scroll lines
Alt+PgUp / Alt+PgDn Scroll a page (the caret stays)
Shift+wheel Horizontal scrolling
Ctrl+= / Ctrl+- / Ctrl+0, Ctrl+wheel Zoom in / out / reset
F11 Full screen (the status line stays)
Ctrl+W, Ctrl+F4 Close the file (back to the empty state)
Alt+F4, Ctrl+Shift+W Quit; unsaved changes ask first
Ctrl+Shift+P, F1 Command Palette: all commands, fuzzy search
Ctrl+P Recent and favorite commands

Unsaved changes show ● in the title strip. Saving replaces the file atomically. When another program changes the file, also while you edit, the status line asks R: Reload (the disk version, with a fresh undo history) or S: Save Current (your text over it). A file with the Windows Read-only attribute is not saved: the ● turns orange and the status line asks to clear the attribute and save again (the editor never changes attributes). A file whose lines end with a lone CR is shown as one line, and the status line says so.

The slider at the right edge shows where the view is in the file: drag it, or press the strip to jump there (the caret stays). Lines longer than 64 KiB are drawn to their end; past 64 KiB every byte takes one column (exact for ASCII), and the status line shows Col ~N.

Files and Sessions

Each session (window) edits one file and never starts, closes or talks to another session. A file comes from the command line or is dragged onto the window:

  • No file: started without a path, or after Ctrl+W, the window shows the empty state, Drop a file here to open it. Nothing can be edited; the palette, About, Keyboard Shortcuts, zoom, full screen and Alt+F4 work.
  • Drag and drop: a file dropped on the empty state, or on a file without unsaved changes, opens in its place. With unsaved changes (or a save running) nothing opens and the status line says why. Of several files only the first opens; folders are refused.
  • Close: Ctrl+W / Ctrl+F4 close the file (asking first about unsaved changes) and the window stays in the empty state; Alt+F4 / Ctrl+Shift+W quit.
  • New files are created only from the command line: a path that does not exist opens an empty document and the first save creates it.
  • --read-only applies to every file opened in the session; --syntax applies to the file named on the command line.
  • Windows does not deliver drops from Explorer to an editor running as administrator.

Search and Replace

Ctrl+F opens the search box at the top right, seeded with the selection or the word at the caret. The count of matches streams in while a large file is searched (2 of 1,204+); invalid patterns and skipped lines are reported below the field. Resting the pointer on a field or button of the box shows its name and key; the arrow on the left shows or hides the replace field.

Keys Action
Ctrl+F, Ctrl+H Find; find and replace
Enter / Shift+Enter, F3 / Shift+F3 Next / previous match
Alt+Enter Select all matches (multi-cursor)
Alt+C / Alt+W Match Case / Whole Word
Alt+G / Alt+R Glob / RegEx mode; both off is Text
Alt+L Find in the selection
Enter or Ctrl+Shift+1 (replace field) Replace one and go to the next
Ctrl+Alt+Enter Replace all, one undo step
Alt+P Preserve Case
Esc Close the search box
  • Text finds the typed text anywhere. Glob: ? is one character, * the shortest text within a line, a trailing * the rest of the line. RegEx uses Rust regular expressions; look-around and backreferences use a bounded engine that skips lines it cannot finish. With them, write line breaks as \n (. with (?s) or \s does not reach the next line), and a pattern that backtracks heavily on a very long line keeps the search busy until it finishes (Esc does not interrupt it).
  • Whole Word keeps accents (combining marks) with their word.
  • Replacements use the VS Code syntax: $1, $<name>, $0, $$, \n, \t and the case operators \u, \l, \U, \L.

Multiple Cursors

The keys follow VS Code. Typing, deleting, pasting and moving apply to every selection; Esc returns to one. Pasted text with one line per cursor puts one line at each.

Keys Action
Ctrl+D; Ctrl+K Ctrl+D Add the next occurrence; move the last one to it
Ctrl+Shift+L, Ctrl+F2 Select all occurrences
Ctrl+Alt+Up / Ctrl+Alt+Down Add a cursor above / below
Shift+Alt+I Add cursors to the ends of the selected lines
Ctrl+L Select the line, then extend by lines
Ctrl+U Undo the last cursor operation
Alt+click Add or remove a cursor
Shift+Alt+drag, middle-drag Column selection
Ctrl+Shift+Alt+Arrows / PgUp / PgDn Column selection by keys

Syntax Highlighting and Code

Code is highlighted with built-in tree-sitter grammars: Bash, Batch, C, C#, C++, CSS, Go, HTML, INI, Java, JavaScript, JSON, Julia, Lua, Markdown, MATLAB, Octave, PowerShell, Python, Rust, SQL, TOML, TypeScript (and TSX), XML and YAML. The language follows the file name (or a #! line); .m files are MATLAB unless they look like Octave. The status line shows it. Windows Batch files (.bat and .cmd) are detected automatically; use --syntax batch (aliases bat, cmd, dosbatch) to select Batch explicitly. INI files (.ini, .cfg, .inf, .editorconfig, .gitconfig, .gitmodules) highlight sections, keys and comments; their sections are the symbols of Go to Symbol.

  • The window opens at once with plain text; the highlights follow within milliseconds. Large files are highlighted around the view first, then completely in the background. Files above syntax.maxFileMiB (32 MiB) stay plain text, also when an edit grows them past it.
  • Markdown highlights its inline elements, fenced code blocks (by the info string, for example ```python), YAML front matter and HTML blocks; HTML highlights <script> and <style>. Comments, auto-closing pairs and brackets follow the embedded language.
Keys Action
Ctrl+K M Change Language Mode (or Plain Text)
Ctrl+/ Toggle Line Comment
Ctrl+K Ctrl+C / Ctrl+K Ctrl+U Add / Remove Line Comment
Shift+Alt+A Toggle Block Comment
Ctrl+Shift+\ Go to the matching bracket
Shift+Alt+Right / Shift+Alt+Left Expand / shrink the selection by syntax nodes
Ctrl+Shift+O Go to a symbol (functions, classes, headings)

Brackets, quotes and backticks close automatically (and are stepped over), Backspace in an empty pair deletes both, a selection is wrapped when an opening bracket or quote is typed, and Enter after an opening bracket (or a Python or YAML :) indents the new line. The bracket pair at the caret is marked.

Spelling

Off by default: set spelling.enabled: true, start with --spelling builtin, or run View: Toggle Spelling. US English words of plain text and Markdown prose are checked (Markdown code, links, HTML and front matter are skipped); misspelled words of the visible rows get a blue wavy underline, and with the caret on one the status line shows Spelling: recieve (Ctrl+.). Code files are not checked.

Keys Action
Ctrl+. Suggestions first, then Add to Dictionary, Ignore, F8
F8 / Shift+F8 Select the next / previous misspelled word (wraps)
  • Ctrl+., Enter replaces the word with the best suggestion (one undo step). Spelling: Add to Dictionary and Spelling: Ignore Word are also palette commands.
  • Engines (spelling.engine): builtin (a US English word list in the executable), hunspell (the Dictionaries/en_US files shipped beside it, or another .aff / .dic pair set by spelling.hunspell) and windows (the Windows spell checker, when US English is installed). An engine that cannot start is reported and the built-in one is used.
  • Added words are kept in UserSettings/Spelling/en_US.txt (one per line, at most 64 KiB and 10,000 words) for every engine; ignored words last for the session.
  • Markdown is checked with syntax highlighting on (its structure comes from the syntax thread); with --syntax none a Markdown file is plain text.

Command Palette

Commands are grouped in families: Application:, File:, Edit:, Selection:, Search:, Go:, Spelling: and View:. Type any part of a name (for example fsave), move with Up / Down / PgUp / PgDn, run with Enter or a click, close with Esc. The search field supports the usual editing keys, Ctrl+A and Ctrl+V.

  • Click the star of a command, or press Ctrl+Space, to add or remove it from the favorites.
  • Ctrl+P lists the last commands run from the palette, then the favorites.
  • File: Copy File Path (Ctrl+K P) copies the full path of the file; File: Copy File Name copies its name.
  • Application: Keyboard Shortcuts (Ctrl+K Ctrl+S) shows all keys; Application: About shows the version and links; Application: Documentation opens the online documentation; Application: Quit (Alt+F4, Ctrl+Shift+W) closes the editor.

Favorites and recent commands are kept in UserSettings/Palette.json beside the executable. A file the editor cannot read or does not accept is left unchanged, and favorites then last for the session.

Configuration

Optional RoyiTextEditor.yaml beside the executable, read at startup and never written by the editor. Problems are shown on the status line; invalid values keep their defaults.

palette:
  recentCount: 3          # recent commands listed by Ctrl+P, 0 to 20 (0: none)
editor:
  multiCursorLimit: 10000 # most selections, 1 to 1,000,000; more is refused
search:
  replaceAllMaxMiB: 512   # memory for one Replace All [MiB], 1 to 4096; more is refused
syntax:
  maxFileMiB: 32          # larger files are not highlighted, 1 to 1024
  injections: true        # embedded languages (Markdown fences, HTML scripts and styles)
spelling:
  enabled: false          # mark misspelled words (plain text, Markdown prose)
  engine: builtin         # builtin, hunspell or windows; a failing engine falls back to builtin
  hunspell: Dictionaries/en_US  # .aff/.dic base, relative to the executable

The settings are read once at startup; restart after a change. The Configuration page describes every setting.

Features

  • Performance: The start up time should be below 100 [Mili Sec] on modern PC. Each operation should feel instant.

Tip

Open an issue for new feature requests.
Feedback is highly appreciated.

Performance

Important

We take performance seriously. We aim to minimize Time to load (TTL), Time to load a file (TTLF) and Time to render a keystroke (TTRK).

Results of the performance test suite per version. Run time in [ms], lower is better.

Development

See DEVELOPMENT.md and Done/Architecture001.md.

Environment

Rust with the x86_64-pc-windows-gnu toolchain (rust-toolchain.toml installs rustfmt and clippy). Linking uses the MinGW runtime bundled with Rust (.cargo/config.toml). The application manifest is compiled by MinGW-w64 windres, which must be on PATH (or set WINDRES to its path).

The application name, file name and version are set in Meta/AppMeta.json; the build fails when its version differs from the workspace version in Cargo.toml or its file name differs from the executable name.

The executable icon is built from Meta/Icon.svg (64 px and up) and Meta/IconSmall.svg (48 px and below, the names drawn as bars). The build script renders both with resvg into a 16–256 px .ico and embeds it.

tools/ also holds auxiliary tools that are not part of the build: the tree-sitter measurement probe (SyntaxProbe), the icon text-to-outline and preview tool (IconOutlines) and Export-IconPng.ps1. Usage is at the top of each file.

cargo test --workspace                                # Tests
cargo clippy --workspace --all-targets -- -D warnings # Lints
cargo fmt --all                                       # Formatting
cargo bench -p rte_text                               # Text engine benchmarks (Ropey baseline)
cargo bench -p rte_render                             # Full-frame render cost (1080p, 4K)
cargo bench -p rte_edit                               # Worst-case caret movement latency
cargo run --release -p rte_app -- <file>              # Run the editor
cargo xtask bench-startup                             # Startup benchmark (gate: p95 < 100 ms)
cargo xtask bench-perf                                # Performance Benchmark (Performance.md)
cargo xtask bench-perf --short                        # Short Benchmark: release-notes table
cargo xtask package                                   # Release ZIP under target/package

Fonts in assets/fonts are not stored in Git (assets/ is ignored). The build downloads missing files automatically: the rte_assets build script runs .\tools\Get-Fonts.ps1, which fetches the five families from pinned releases and verifies their SHA-256 hashes. Archives are cached in target/font-cache. Run the script directly to refresh (-Force) or to fetch without building.

Release

  1. Set the same version in Meta/AppMeta.json and in [workspace.package] of Cargo.toml.
  2. In CHANGELOG.md, move the ## [Unreleased] entries under a new ## [X.Y.Z] - YYYY-MM-DD section and keep an empty ## [Unreleased] above it. For performance results, put the Short Benchmark table under ### Performance (see Performance.md: copied from the version's full results, or from cargo xtask bench-perf --short when there are none).
  3. Check locally: .\.github\scripts\Resolve-Version.ps1.
  4. Commit, then push an annotated tag: git tag -a vX.Y.Z -m "X.Y.Z" and git push origin vX.Y.Z.

The Release workflow checks that the versions and the tag match, takes the release notes from the CHANGELOG.md section, runs the format check, Clippy and the tests, builds and packages the ZIP with its SHA-256 file, and publishes the GitHub release. A pre-release suffix (v1.0.0-rc.1) publishes a pre-release. Running the workflow manually is a dry run: the ZIP and notes (from ## [Unreleased]) are uploaded as a workflow artifact and nothing is published.

Documentation

docs/src/SUMMARY.md defines the sections and page hierarchy. Page content is separate, starting with docs/src/introduction.md.

Build or preview through the script, which reads SUMMARY.md directly and regenerates screenshots for the book:

.\tools\Build-Docs.ps1
.\tools\Build-Docs.ps1 -Serve

About

A portable, keyboard workflow focused Text and Code Editor

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Sponsor this project

Contributors

Languages