This guide covers setting up your development environment and contributing to reovim.
| Requirement | Version |
|---|---|
| Rust | 1.92+ (2024 edition) |
| cargo | Latest stable |
| rustfmt | Latest stable |
| clippy | Latest stable |
Essential commands for development:
# Build all crates
cargo build
# Run the editor
cargo run
# Run tests
cargo test
# Format and lint
cargo fmt && cargo clippyFor the full command reference including server mode, CLI client, benchmarks, and debugging options, see CLAUDE.md.
This project enforces a zero-warning policy. All code must compile without any warnings from:
cargo build # Must produce zero warnings
cargo clippy # Must produce zero warningsNo warnings are acceptable. This is non-negotiable.
Before committing:
- Run
cargo build- verify zero warnings - Run
cargo clippy- verify zero warnings - Run
cargo fmt- ensure consistent formatting
- Follow existing code patterns
- Keep functions focused and small
- Prefer clarity over cleverness
- Avoid unnecessary abstractions
- Never add module-specific code to kernel
- If API is insufficient, propose an extension (see module-development.md)
- Modules must be fully self-contained
The project follows a server/client architecture:
reovim/
├── apps/bin/ # Main binary entry point (reovim-app)
├── server/ # Server-side components
│ ├── lib/
│ │ ├── kernel/ # reovim-kernel - core mechanisms (mm/, ipc/, core/)
│ │ ├── server/ # reovim-server - gRPC handlers, session management
│ │ └── drivers/ # Server drivers (14 crates)
│ │ ├── command/ # Command trait and registry
│ │ ├── input/ # Key events and input parsing
│ │ ├── syntax/ # Tree-sitter integration
│ │ ├── lsp/ # Language server protocol
│ │ ├── vfs/ # Virtual filesystem
│ │ ├── session/ # Session management
│ │ ├── buffer/ # Buffer operations
│ │ └── ... # (undo, search, clipboard, ffi, etc.)
│ └── modules/ # Policy modules (21 loadable modules)
│ ├── vim/ # Core Vim-like behavior
│ ├── editor/ # Editor core operations
│ ├── motions/ # Movement commands
│ ├── textobjects/ # Text object definitions
│ ├── keymap/ # Keymap definitions
│ ├── mode-manager/ # Mode system
│ └── ... # (options, buffer-ops, clipboard, search, etc.)
├── clients/ # Client applications
│ ├── cli/ # CLI client (gRPC v2)
│ ├── tui/ # TUI client (gRPC v2)
│ │ └── lib/drivers/ # TUI-specific drivers (tui, display)
│ └── web/ # Web client (gRPC-Web, WASM)
├── shared/ # Shared libraries
│ ├── protocol/ # gRPC v2 protocol definitions
│ ├── arch/ # Platform abstraction (unix/, windows/)
│ ├── net/ # Network transport layer
│ ├── log/ # Logging infrastructure
│ ├── module-macros/ # `declare_module!` proc-macro
│ └── testing/ # Integration test utilities
├── tools/
│ ├── bench/ # Performance benchmarks (criterion)
│ └── perf-report/ # Performance report generator
└── perf/ # Versioned performance reports
- Kernel (
server/lib/kernel/): Core mechanisms, policy-agnostic - Drivers (
server/lib/drivers/): Service providers with trait contracts - Modules (
server/modules/): Policy implementations (vim behavior, keymaps, etc.) - Server (
server/lib/server/): gRPC handlers, session management, module registry
Modules implement traits from kernel/drivers and are loaded dynamically.
For detailed architecture, see architecture overview.
RUST_BACKTRACE=1 cargo run -p reovim
RUST_BACKTRACE=full cargo run -p reovim # Full backtrace- Use
dbg!()macro for quick value inspection - Check
server/lib/server/src/for server-side event loop debugging - Event flow: gRPC Input → Key resolver → Module handlers → State changes
When troubleshooting LSP integration issues (rust-analyzer, etc.):
# Log to timestamped file in data directory
reovim --lsp-log=default myfile.rs
# Log to custom file
reovim --lsp-log=/tmp/lsp.log myfile.rs
# Log with specific level (error, warn, info, debug, trace)
reovim --lsp-log=default:debug myfile.rs
reovim --lsp-log=/tmp/lsp.log:info myfile.rsLog format shows direction (-> outgoing, <- incoming) and JSON-RPC messages:
[2026-01-06T12:00:00Z] -> initialize { ... }
[2026-01-06T12:00:01Z] <- initialized { ... }
[2026-01-06T12:00:02Z] -> textDocument/didOpen { ... }
:LspLogThis opens the current LSP log file in a new buffer.
:healthNavigate to the "LSP" section to see:
- Server status (running/stopped)
- Document count
- Diagnostic statistics
- Timestamps for initialization and last activity
Diagnostics not appearing:
- rust-analyzer uses LSP 3.17 "pull diagnostics"
- Reovim requests diagnostics after
textDocument/didOpen - Check
:healthto verify server is running
Server not starting:
- Verify LSP server is installed (
which rust-analyzer) - Check LSP log for error messages
- Ensure file is in a project directory (has
Cargo.tomlfor Rust)
Slow completions:
- LSP completions are async and debounced
- Large projects may have slower initial indexing
- Check LSP log for timeout messages
Reovim prioritizes minimal latency:
- Keep the main event loop fast
- Avoid blocking operations in handlers
- Use async I/O for all terminal operations
- Profile with
cargo flamegraphfor hot paths
# Run all benchmarks
cargo bench -p reovim-bench
# Run specific benchmark group
cargo bench -p reovim-bench -- window_render
# Generate performance report
cargo run -p perf-report -- update --version X.Y.Z
# Compare versions
cargo run -p perf-report -- compare 0.3.0 0.4.2| Metric | v0.6.0 | v0.7.10 | Change |
|---|---|---|---|
| Window render (10 lines) | 10 µs | 5.3 µs | -47% |
| Window render (10k lines) | 56 µs | 26 µs | -54% |
| Full scroll cycle | 85 µs | 55 µs | -35% |
| Large file (5k lines) | 174 µs | 87 µs | -50% |
| Throughput | 18k/sec | 38k/sec | +111% |
v0.7.x Improvements: Optimized render pipeline while maintaining frame buffer benefits:
- Zero flickering - Only changed cells sent to terminal
- 2x faster rendering - Optimized pipeline stages
- Composable layers - Clean separation of UI components
- Saturator architecture - Background async computation
See perf/ directory for detailed versioned performance reports.
- Key press to screen update: < 16ms (60fps) - Achieved: <1ms
- File operations: async, non-blocking
- Rendering: incremental when possible
- Architecture - System design overview
- Commands - Command system and execution
- Testing - Running and writing tests