______ ______ ______ __ __ __ ______ /\ == \ /\ __ \ /\__ _\ /\ \ /\ "-.\ \ /\ __ \ \ \ _-/ \ \ __ \ \/_/\ \/ \ \ \ \ \ \-. \ \ \ __ \ \ \_\ \ \_\ \_\ \ \_\ \ \_\ \ \_\\"\_\ \ \_\ \_\ \/_/ \/_/\/_/ \/_/ \/_/ \/_/ \/_/ \/_/\/_/
Patina is a lightweight, modal TUI (Terminal User Interface) text editor built in Rust. It aims to bridge the gap between the efficiency of Vim and the approachable aesthetics of modern editors like LazyVim.
Patina is built using the robust Ratatui ecosystem and handles modern terminal requirements like UTF-8/Unicode characters seamlessly.
- Modal Editing: Vim-inspired workflow with distinct Normal and Insert modes.
- Hybrid Navigation: Supports both classic
HJKLbindings and standard Arrow keys. - Modern Dashboard: A clean startup screen with quick actions when no file is loaded.
- UTF-8 Safe: Robust handling of multi-byte characters, emojis, and accents (no crashes on
çor🦀). - Visual Feedback: Dynamic cursor styles (Block vs. Bar) and status bar colors based on the active mode.
- Smart Scrolling: Automatic viewport adjustment and relative line numbering.
- Persistence: Global hotkey to save your work to disk instantly.
Ensure you have Rust and Cargo installed.
git clone [https://github.com/your-username/patina.git](https://github.com/your-username/patina.git)
cd patinaTo open the dashboard:
cargo run
# or if built: ./patinaTo open a specific file directly:
cargo run -- my_file.txtPatina uses a modal input system.
| Key | Action |
|---|---|
Ctrl + s |
Save File (Write buffer to disk) |
| Key | Action |
|---|---|
h / ← |
Move Cursor Left |
j / ↓ |
Move Cursor Down |
k / ↑ |
Move Cursor Up |
l / → |
Move Cursor Right |
Shift + i (or I) |
Enter Insert Mode |
e |
Edit (from Dashboard) |
? |
Toggle Help Popup |
q |
Quit Patina |
| Key | Action |
|---|---|
Typing |
Insert text |
Enter |
New line |
Backspace |
Delete character / Merge lines |
Esc |
Return to Normal Mode |
Arrows |
Move Cursor (Convenience) |
The project is structured into modular components:
main.rs: Entry point, argument parsing (clap), and the main event loop.app.rs: Application state, buffer management, UTF-8 logic, and movement algorithms.ui.rs: Rendering logic usingratatui. Handles the dashboard, layout splitting, and cursor styling.tui.rs: Boilerplate for setting up and restoring the terminal raw mode.
The following features are planned for future releases:
- Command Mode (
:): Support for commands like:w,:q, and:w <filename>. - Search (
/): Find text within the buffer. - Syntax Highlighting: Basic coloring for common file types.
- Clipboard Support: Copy/Paste integration with the system clipboard.
This project is open-source and available under the MIT License.