A modern terminal-based word processor for Markdown, HTML, and other structured text documents.
Pure brings structured document editing to the command line. Unlike traditional text editors that work with plain text, Pure works with semantic document elements—headings, lists, quotes, code blocks—allowing you to focus on content rather than formatting syntax.
Note: Pure is currently in alpha. While the core functionality is stable and usable for daily work, some features are still under development and you may encounter rough edges. Please report any issues you find!
# Install from crates.io
cargo install pure-tui
# Open or create a document
pure document.ftml
# Or work with Markdown
pure notes.md
# Or start with an untitled document and name it on first save
purePure documents are made up of paragraphs, each with a specific type:
Paragraph Types:
- Text - Regular body paragraphs
- Headings (H1, H2, H3) - Section headings at different levels
- Quote - Block quotations
- Code Block - Preformatted code or monospaced text
- Numbered List - Ordered list items
- Bullet List - Unordered list items
- Checklist - Task items with checkboxes (
[ ]and[x])
Inline Styles:
- Bold - Strong emphasis
- Italic - Emphasis
- Underline - Underlined text
- Strikethrough - Deleted or deprecated text
- Highlight - Highlighted text
- Code - Inline code or monospaced text
- Hyperlink - Clickable links
Pure provides an intuitive editing experience:
- Word Wrapping: Automatic text flow without manual line breaks
- Mouse Support: Click to position cursor, drag to select, double-click to select words, triple-click for paragraphs
- Clipboard: Cut, copy, and paste — within Pure with formatting preserved; copying reaches the system clipboard through the terminal (OSC 52), pasting from other applications works via the terminal's paste shortcut (bracketed paste)
- Reveal Codes: Press F9 to see the underlying formatting structure (inspired by WordPerfect)
- Menu Bar: Press F10 (or an Alt accelerator like Alt+F) for a TurboVision-style menu bar
- Context Menu: Press Esc to access all formatting options
- Real-time Rendering: See your formatted document as you type
Pure is built on tdoc and understands a range of structured text formats — Markdown, HTML, Gemini, and its native FTML.
Every document is held in a single internal representation (the model FTML is built on). Most structure and formatting maps cleanly from one format to another, but a few formats can express things this model doesn't capture — images embedded in an HTML page, for instance. When a document relies on such a feature, that detail can't be represented and is dropped when the file is saved.
What that means in practice:
- FTML is the only format guaranteed to round-trip with no loss whatsoever.
- Markdown is generally safe to round-trip, though files may be reformatted or rewrapped along the way.
- HTML, Gemini, and others preserve everything Pure understands; anything outside its model is not written back on save.
Pure is designed for efficiency with comprehensive keyboard shortcuts:
- Ctrl+N - New untitled document
- Ctrl+O - Open document (file dialog with tab completion)
- Ctrl+S - Save document (asks for a name when untitled)
- Ctrl+Q - Quit (with save prompt)
- Ctrl+Z / Ctrl+Y - Undo / redo
- Ctrl+X / Ctrl+C / Ctrl+V - Cut / copy / paste
- Esc - Open context menu
- F10 - Open the menu bar (Alt+F, Alt+E, ... open a menu directly)
- F9 - Toggle reveal codes
- Ctrl+P - Create new paragraph at same level
- Ctrl+J - Insert line break within paragraph (useful for addresses, poetry, etc.)
- Arrow keys - Navigate (Ctrl+Left/Right for word jumps)
- Context menu shortcuts - Quick paragraph type changes (0-9)
See the User Guide for comprehensive documentation.
If you have Rust installed:
cargo install pure-tuigit clone https://github.com/roblillack/pure.git
cd pure
cargo build --release
cargo install --path .Pre-built binaries for Linux, macOS, and Windows are available on the releases page.
# Start with a new FTML document
pure newfile.ftml
# Open an existing document
pure document.ftml
# Work with Markdown
pure notes.md
# Open and convert from HTML
pure webpage.htmlNavigation:
- Arrow keys - Move cursor
- Ctrl+Left/Right - Jump by word
- Home/End - Start/end of line
- PageUp/PageDown - Scroll by page
Editing:
- Enter - New paragraph
- Shift+Enter - Newline within paragraph
- Backspace/Delete - Remove text
- Ctrl+W - Delete word backward
- Ctrl+Z - Undo
- Ctrl+Y - Redo
- Ctrl+X - Cut selection
- Ctrl+C - Copy selection
- Ctrl+V - Paste
Formatting:
- Esc - Open context menu
- 0-9 (in menu) - Change paragraph type
- b/i/u/s (in menu) - Toggle inline styles
File Operations:
- Ctrl+N - New untitled document
- Ctrl+O - Open (file dialog with tab completion)
- Ctrl+S - Save (asks for a name when untitled)
- Save As... in the File menu saves under a new name
- Ctrl+Q - Quit
Special Features:
- F10 - Menu bar (Alt+F/E/I/O/V open a menu directly)
- F9 - Reveal codes mode
FTML (Formatted Text Markup Language) is Pure's native document format — the one it round-trips losslessly. It's a strict subset of HTML5, designed for simplicity and ease of processing, so every FTML file is also valid HTML that opens in any web browser.
FTML provides the essential features needed for rich text documents—such as paragraph structures, headings, lists, and inline styles—without the complexity of full HTML or Markdown. It's ideal for straightforward text content like notes, documentation, memos, and help files.
Key features:
- Simple structure: Only the most essential formatting options
- HTML-compatible: Valid FTML is valid HTML5
- Diffable: Designed to work well with version control
- Unambiguous: Usually only one way to express something
For the full FTML specification and the underlying library, see tdoc.
Pure is built on top of tdoc, a comprehensive Rust library for handling FTML, Markdown, HTML, and Gemini documents. The editor architecture features:
- Efficient Rendering: Paragraph-level caching for smooth performance with large documents
- Visual Cursor Tracking: Maintains cursor position across wrapping and reformatting
- Structural Editing: Direct manipulation of document structure, not just text
- Reveal Codes: Inspired by WordPerfect, showing exact formatting boundaries
See ARCHITECTURE.md for detailed technical documentation.
Pure is under active development. Current status:
Core Editing:
- Text input with full Unicode support
- Cursor navigation (keyboard and mouse)
- Text selection (visual selection with mouse and keyboard)
- Word wrapping with dynamic reflow
Paragraph Types:
- Text paragraphs
- Headings (H1, H2, H3)
- Ordered lists with nesting
- Unordered lists with nesting
- Checklists with checkboxes
- Block quotes with nesting
- Code blocks
Inline Styles:
- Bold
- Italic
- Underline
- Strikethrough
- Highlight
- Inline code
- Hyperlinks (displayed but not editable yet)
File Operations:
- FTML reading and writing
- Markdown import and export
- HTML import and export
- Gemini (Gemtext) import and export
User Interface:
- Context menu (Esc)
- Reveal codes mode (F9)
- Mouse support (click, drag, select, scroll)
- Status bar with document info
Advanced Features:
- Undo/Redo (Ctrl+Z / Ctrl+Y)
- Find and replace
- Multiple documents with tabs
- System clipboard integration
- Interactive hyperlink editing
- User Guide - Comprehensive documentation for all features
- Architecture - Technical overview of editor internals
- FTML Specification - Format details
- tdoc Library - Document handling library
# Clone the repository
git clone https://github.com/roblillack/pure.git
cd pure
# Build release version
cargo build --release
# Run tests
cargo test
# Run benchmarks
cargo bench
# Watch the scripted demo play out live in your terminal
cargo run --example demo
# Re-record the demo GIF above from the same script
cargo run --release --example demo --features recorder
# The binary will be in target/release/pure
./target/release/purePure is ideal for:
- Email Writing: Compose rich-formatted emails with structure and style. Pure integrates seamlessly with TUI-based email clients like Elma
- Technical Writing: Documentation with code examples and structured content
- Note-Taking: Quick notes with proper formatting and organization
- Meeting Notes: Structured notes with checklists and action items
- Terminal Workflows: Document editing without leaving the command line
- Git-Friendly Documents: Version-controlled content with clean diffs
- Markdown Alternative: Structured editing instead of syntax memorization
Pure embraces several design principles:
- Structure over Syntax: Work with document elements, not markup syntax
- Keyboard Efficiency: Every feature accessible via keyboard shortcuts
- Visual Clarity: See your formatted document, not raw markup (unless you want to with F9)
- Format Preservation: Lossless round-trips in FTML, safe (reformat-only) round-trips in Markdown, and honesty about what other formats can't preserve
- Terminal Native: Built for terminal use, not a web editor in disguise
- Git Friendly: FTML format designed for version control
MIT
Contributions are welcome! Pure is under active development. Please see the issues page for planned features and known bugs.
Areas where contributions would be especially valuable:
- Clipboard integration
- Find and replace functionality
- Additional export formats
- Performance optimizations
- Documentation improvements
Pure is inspired by classic word processors like WordPerfect, bringing their structured editing approach to modern terminal environments. The FTML format and document handling are powered by tdoc.
