GitHunt
NA

A very, very minimal TUI application for composing prose.

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 --release

Usage

# Open an existing file
proser myfile.txt

# Create a new file (and parent directories if needed)
proser path/to/new/file.md

# Show usage
proser

Keybindings

  • Ctrl+A - Move to beginning of line
  • Ctrl+E - Move to end of line
  • Ctrl+F - Move forward one character
  • Ctrl+B - Move backward one character
  • Ctrl+N - Move to next line (down)
  • Ctrl+P - Move to previous line (up)
  • Alt+F - Move forward one word
  • Alt+B - Move backward one word
  • Arrow keys - Standard navigation
  • Page Up - Move to previous paragraph
  • Page Down - Move to next paragraph
  • Home - Jump to beginning of line
  • End - Jump to end of line

Editing

  • Ctrl+D - Delete character under cursor
  • Ctrl+K - Kill (delete) from cursor to end of line
  • Alt+D - Delete word forward
  • Ctrl+H or Backspace - Delete character before cursor
  • Enter - New line
  • Tab - Insert tab

Application Commands

  • Ctrl+S - Save file
  • Ctrl+Q - Quit (with unsaved changes warning)
  • Ctrl+Z - Undo last change
  • Ctrl+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-textarea for 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 test

Requirements

  • 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]