# Sintexy

A lightweight, keyboard-driven terminal text editor written in Rust. In the
spirit of GNU nano and micro — simple enough to pick up in 60 seconds, fast
enough not to think about.

```
+---------------------------------------------------------+
|   1  fn main() {                                         |
|   2      println!("hello, sintexy");                     |
|   3  }                                                   |
|                                                          |
| Sintexy  main.rs  [rust]      Ln 2, Col 9 | UTF-8 | LF   |
| Sintexy ready — F1 for help                              |
+---------------------------------------------------------+
```

*(actual UI uses a tokyo-night-style 256-colour theme — screenshot TBD)*

## What it is

- One binary, three runtime dependencies (`crossterm`, `unicode-width`,
  `unicode-segmentation`).
- Edits one or many files in tabs, with line numbers, undo/redo, incremental
  search, and per-language syntax highlighting (Rust, Python, JS/TS, C/C++,
  Shell, JSON, TOML, Markdown).
- Renders only the rows that have changed since the last frame.
- Graceful degradation to 16-colour mode on dumb terminals.

## Build

```sh
cargo build --release
./target/release/sintexy [file]
```

Release-mode binary is < 2 MB on x86-64 Linux thanks to `opt-level = "z"`,
LTO, and `strip = true`.

## Keybindings

| Key            | Action                                |
|----------------|---------------------------------------|
| Ctrl-Q         | Quit (prompts if unsaved)             |
| Ctrl-S         | Save                                  |
| Ctrl-Shift-S   | Save as…                              |
| Ctrl-F         | Find                                  |
| Ctrl-N         | Toggle line-number gutter             |
| Ctrl-T         | New tab                               |
| Ctrl-Tab       | Cycle tabs                            |
| Ctrl-W         | Close tab                             |
| Ctrl-Z / Ctrl-Y| Undo / redo                           |
| F1 or Ctrl-H   | Help overlay                          |
| Arrows         | Move cursor                           |
| Ctrl-← / Ctrl-→| Jump by word                          |
| Home / End     | Line start / line end                 |
| PgUp / PgDn    | Page up / page down                   |
| Tab            | Insert four spaces                    |
| Esc            | Cancel current prompt / overlay       |

While the search bar is open: type to incrementally jump to the first match,
Enter to advance to the next, Esc to abort and return the cursor.

## Notes

- `Ctrl-Shift-S` and `Ctrl-Tab` rely on the terminal forwarding those exact
  modifier combinations. On terminals that swallow them, use `Ctrl-W` to
  close the current tab and re-create it from the new-tab key to switch.
- Tabs in opened files are rendered as single characters; pressing Tab while
  editing inserts spaces (configurable; default 4).
- Encoding is UTF-8 throughout; non-UTF-8 bytes are replaced lossily on load.
