Skip to content

modcrafter77/xless

Repository files navigation

xless

xless is a viewer-first TUI editor for macOS, Linux, and Windows, built in Rust. It opens very large files (100 MB to GB) quickly, stays responsive under heavy operations, and provides a simple, explicit Edit mode (no vim semantics).

Why xless

Most terminal editors either:

  • load too much into memory,
  • freeze on big logs,
  • or expect you to worship modal editing.

xless is optimized for the common workflow: open a huge file, inspect/search it fast, and only edit when you explicitly switch to Edit mode.

Key features

  • Fast open for big files (read-mostly mode for very large inputs)
  • Viewer-first UX (less-style navigation and search)
  • Explicit modes:
    • View mode (default): safe navigation/search
    • Edit mode: predictable editing (nano/FAR-like)
  • No full-file copying: piece table (original + add buffer)
  • UTF-8 safe editing: operations respect code point boundaries
  • Async heavy work: search/highlight/indexing runs in workers, UI stays responsive
  • Windowed rendering: renders only the visible viewport

Status

This project is in active development. Core phases (0–7) are implemented: stable TUI lifecycle, piece table model, UTF-8 safety, viewport rendering, basic editor, modes, less-style search, and async job architecture.

Build

Prerequisites

  • Rust stable (latest recommended)

Build and run

# Build (optimized)
cargo build --release

# Run
cargo run --release -- path/to/file.txt

Large files and read-mostly mode

For very large files xless can enter read-mostly mode to avoid expensive operations and keep memory usage predictable. In this mode, editing may be disabled or limited by design (viewer-first).

If your build has a specific size threshold (for example 200 MB), document it here. If you changed the threshold in code, update this README accordingly.

Usage

Modes

  • View mode (default)

    • Safe navigation
    • Search and match navigation
    • Paging and jumps
    • Designed to behave like a familiar viewer (less/FAR)
  • Edit mode

    • Explicitly enabled
    • Normal typing, delete/backspace, line breaks
    • Undo/redo
    • Intended for focused edits, not bulk transformations

The status line shows the current mode and prompts.

Search

  • Search is asynchronous to avoid UI freezes on large inputs.
  • Matches can be navigated forward/backward.
  • After edits, search results are invalidated and must be rerun (prevents stale offsets).

Note: search may support regex depending on the current implementation.

Key bindings

xless intentionally keeps bindings simple and viewer-first. The exact mapping may evolve while the project stabilizes.

View mode (typical)

  • Arrow keys: move cursor
  • PageUp/PageDown: page navigation
  • /: search prompt
  • n / N: next/previous match
  • g / G: jump to start/end (if implemented)
  • q: quit (or via Ctrl-Q, depending on platform)

Edit mode (typical)

  • Typing: insert text
  • Backspace/Delete: remove text
  • Ctrl-S: save
  • Ctrl-Z / Ctrl-Y: undo/redo (or other configured bindings)

If your actual bindings differ, update this section to match the code. (Prefer documenting only what is implemented.)

Testing

# Unit tests
cargo test

# Optional: large-file smoke tests (if present in the repo)
./tests/test_large_file.sh

Recommended additional checks:

  • Open a multi-hundred-megabyte log file and confirm UI remains responsive during async search.
  • Validate behavior on non-UTF-8 input (should remain visible, not disappear).

Roadmap (near-term)

  • More robust line/column mapping for long lines and extreme horizontal scroll
  • Viewport-only syntax highlighting (tree-sitter “on window”)
  • Bulk operations in view mode (filter/export)
  • Optional AI-assisted analysis as an external process (kept out of the core editor)

License

Apache-2.0

Copyright Modcrafter © 2026

About

less command with bells and whistles

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors