Metadata-Version: 2.4
Name: riched
Version: 0.4.1
Summary: TUI editor with VSCode keybindigs
Project-URL: Repository, https://github.com/hoishing/riched
Requires-Python: >=3.12
Requires-Dist: pyyaml>=6.0.3
Requires-Dist: textual[syntax]>=8.2.4
Requires-Dist: tree-sitter-typescript>=0.23.2
Description-Content-Type: text/markdown

# Riched

A [rich](https://github.com/Textualize/rich) framework-powered editor(hence the name `riched`) that implements VS Code keybindings in a TUI to the best extent possible.

> [!NOTE]
> `riched` is designed to work with [ghostty](https://ghostty.org) in macOS only

## Key Features

- vscode text editing key bindings
- macOS style key bindings work in ssh session to linux host also
- multiple built-in theme(atom, drcula, nordic ...etc)
- syntax highlighting for major file formats
- quick file open with fuzzy search

## Usage

```sh
uv tool install riched
riched .
riched --version
```

## Dev

```sh
uv sync
uv run riched .
uv run python -m tests.runner
```

## Key Bindings

Key bindings are generated from the YAML in `src/riched/bindings.yaml`.

App shortcuts:

| Shortcut | Action |
| --- | --- |
| `⌘S` | Save |
| `F1` | Command palette |
| `⌘B` | Toggle file tree |
| `⌘P` | Quick open |

Editor shortcuts:

| Shortcut | Action |
| --- | --- |
| `⌥↑` | Move line up |
| `⌥↓` | Move line down |
| `⌥⇧↑` | Copy line up |
| `⌥⇧↓` | Copy line down |
| `⌥⌫` | Delete word left |
| `⌘⌫` | Delete to line start |
| `⌘Z` | Undo |
| `⌘⇧Z` | Redo |
| `⌘X` | Cut |
| `⌘/` | Toggle line comment |
| `⌥Z` | Toggle word wrap |
| `⌥⇧←` | Select word left |
| `⌥⇧→` | Select word right |
| `⌘L` | Select line |
| `⌘⇧K` | Delete line |
| `⌘⇧←` | Select to line start |
| `⌘⇧→` | Select to line end |

## Settings

`riched` persists the selected Textual theme in `settings.yaml` under the user config directory: `~/Library/Application Support/riched/settings.yaml`

## Limitations

- `riched` does not support multi-cursor editing because Textual `TextArea`
  currently models one active cursor/selection.
- Some Command-key shortcuts can conflict with Ghostty or terminal-level
  bindings, for example `⌘Enter`, `⌘⇧Enter`, `⌘[`, `⌘]`, `⌘⇧P`, `⌘W`, `⌘Q`...etc
- `riched` will not implement key bindings that require users to modify the
  Ghostty terminal configuration, since terminal-specific configuration makes
  shortcuts harder to document, test, and support consistently across
  environments.
