Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Development

Prerequisites

  • Rust (stable toolchain)
  • just (optional, for the justfile recipes)

Commands

CommandAction
cargo buildDebug build
cargo build --releaseRelease build
cargo run -- [path]Run with optional path
cargo testRun all tests
cargo checkType-check only
cargo clippy --all-targets -- -D warningsLint
cargo fmt --allFormat code

Or use the justfile shortcuts:

CommandAction
just buildDebug build
just run .Run against the current directory
just testRun the test suite
just clippyLint

Before committing

  1. cargo fmt --all — check formatting
  2. cargo clippy --all-targets -- -D warnings — no warnings
  3. cargo test — all tests pass
  4. cargo check — no type errors
  5. No debug println!, dbg!, or commented-out code

Project structure

src/
├── main.rs             # Entry: terminal setup, event loop, dispatch
├── lib.rs              # Crate root, re-exports the modules below
├── app/                # App state and input handling
│   ├── mod.rs          #   core App state + overlays
│   ├── key_handlers/   #   keyboard dispatch (incl. open-in-editor)
│   ├── mouse_handlers.rs #  click/scroll handling
│   ├── navigation.rs   #   tree movement & expand/collapse
│   ├── content_pos.rs  #   scroll / wrap position math
│   └── file_ops.rs     #   load files, JSON pretty-print, reloads
├── ui/                 # ratatui rendering
│   ├── mod.rs          #   layout & frame composition
│   ├── tree.rs         #   tree panel
│   ├── content/        #   content panel (incl. blame gutter, diffs)
│   ├── popups/         #   search / history / palette / help popups
│   └── statusbar.rs    #   status bar
├── config/             # mantis.toml deserialization, keybinding parsing
├── command_palette.rs  # Ctrl+P action list + fuzzy matching
├── search.rs           # fuzzy file + full-text content search
├── selection.rs        # text selection model
├── tree.rs             # Flat Vec<TreeNode> from ignore::WalkBuilder
├── file.rs             # Binary file detection (null-byte check)
├── virtual_file.rs     # memory-mapped, lazily indexed large files
├── theme.rs            # Theme struct + presets, color parsing
├── git.rs              # Shells out to `git` for log/diff/blame
├── highlight.rs        # syntect syntax highlighting → ratatui styles
└── release_info.rs     # bundled "what's new" release metadata