THIS IS SLOP.
TODO: Rewrite.
Proser
A minimal, distraction-free terminal application for writing prose, built with Rust and Ratatui.
Features
- Focus Mode: Current paragraph is highlighted, all other paragraphs are dimmed using your terminal's color scheme
- Centered Layout: Text displayed in a centered 55-column area for comfortable reading and writing
- Smart Paragraph Reflow: Entire paragraphs automatically reflow as you type when any line exceeds 55 characters, maintaining optimal line breaks throughout
- Scrolling Support: Seamlessly navigate long documents with automatic scrolling that keeps the cursor visible
- Undo/Redo: Full undo/redo support with 50 levels of history
- Emacs/macOS Keybindings: Full support for familiar editing shortcuts
- Autosave: Automatically saves every 10 seconds
- UTF-8 Support: Full Unicode text support
- File Management: Creates parent directories automatically, atomic saves to prevent data loss
Installation
# From the project directory
cargo install --path .
# Or build and run directly
cargo build --releaseUsage
# Open an existing file
proser myfile.txt
# Create a new file (and parent directories if needed)
proser path/to/new/file.md
# Show usage
proserKeybindings
Navigation
Ctrl+A- Move to beginning of lineCtrl+E- Move to end of lineCtrl+F- Move forward one characterCtrl+B- Move backward one characterCtrl+N- Move to next line (down)Ctrl+P- Move to previous line (up)Alt+F- Move forward one wordAlt+B- Move backward one wordArrow keys- Standard navigationPage Up- Move to previous paragraphPage Down- Move to next paragraphHome- Jump to beginning of lineEnd- Jump to end of line
Editing
Ctrl+D- Delete character under cursorCtrl+K- Kill (delete) from cursor to end of lineAlt+D- Delete word forwardCtrl+HorBackspace- Delete character before cursorEnter- New lineTab- Insert tab
Application Commands
Ctrl+S- Save fileCtrl+Q- Quit (with unsaved changes warning)Ctrl+Z- Undo last changeCtrl+Y- Redo last undo
Status Information
- Top Left: Current filename
- Top Right: Modified indicator (
[modified]) and save confirmation ([saved]) - Bottom Center: Word count
Color Scheme
Proser uses your terminal's built-in color scheme:
- Background: Terminal default
- Current paragraph: Terminal default foreground
- Dimmed paragraphs: Dark gray
- Filename: Cyan
- Warning text: Red
Architecture
The application is structured into four main modules:
- main.rs: Entry point, event loop, and keybinding handlers
- app.rs: Application state management, file I/O, and paragraph detection
- ui.rs: Rendering logic, word wrapping, focus effect, and status bars
- colors.rs: Terminal color constants
Technical Details
- Uses
tui-textareafor robust text editing capabilities - Custom rendering layer for word wrapping and focus mode
- Atomic file saves (write to temp file, then rename)
- Paragraph detection based on blank line separators
- 100ms event polling for responsive autosave
Building from Source
# Debug build
cargo build
# Release build (recommended)
cargo build --release
# Run tests (when available)
cargo testRequirements
- Rust 2021 edition or later
- Terminal with UTF-8 support
- ANSI color support recommended for best experience
License
[Add your license here]
Contributing
[Add contribution guidelines here]