Metadata-Version: 2.4
Name: grass-editor
Version: 0.1.3
Summary: A calm, zero-config terminal code editor.
Author: Mukund Jha
License-Expression: MIT
Project-URL: Homepage, https://github.com/mukundzha/grass
Project-URL: Repository, https://github.com/mukundzha/grass
Project-URL: Issues, https://github.com/mukundzha/grass/issues
Keywords: editor,terminal,tui,curses,text-editor,cli
Classifier: Development Status :: 3 - Alpha
Classifier: Environment :: Console
Classifier: Environment :: Console :: Curses
Classifier: Intended Audience :: Developers
Classifier: Operating System :: POSIX
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Topic :: Text Editors
Classifier: Topic :: Text Editors :: Text Processing
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: pygments>=2.6
Dynamic: license-file

# Grass

A calm, zero-config terminal code editor.

No modes. No config files. Just type.

[![tests](https://github.com/mukundzha/grass/actions/workflows/tests.yml/badge.svg)](https://github.com/mukundzha/grass/actions/workflows/tests.yml)
[![PyPI](https://img.shields.io/pypi/v/grass-editor.svg)](https://pypi.org/project/grass-editor/)

![Grass demo](https://raw.githubusercontent.com/mukundzha/grass/17b0c4e/docs/demo.gif)

## Why

Nano starts instantly but stays plain. Vim and Helix are powerful, but they ask
you to learn an editing language first. Grass sits between them: one mode, one
theme, syntax highlighting, and about 1,700 lines of Python you can read in an
afternoon.

It is not a Vim replacement. No plugins, no LSP, no mouse. One file at a time,
on purpose.

## Install

```bash
pipx install grass-editor
```

No pipx? `pip install grass-editor` also works. On Windows, install curses
support first:

```bash
pip install windows-curses
pip install grass-editor
```

Python 3.9 or newer.

## Run

```bash
grass hello.py
```

With no file, `grass` opens the splash. `grass --version` prints the version.

## A look

| Splash | Ctrl-P finder |
| --- | --- |
| ![Grass splash](https://raw.githubusercontent.com/mukundzha/grass/main/docs/splash.png) | ![Grass finder](https://raw.githubusercontent.com/mukundzha/grass/main/docs/finder.png) |

One theme, Meadow: warm off-white text, green keywords, gold functions, a dark
status bar. It assumes a dark 256-color terminal; basic colors fall back.

## Keys

| Key | Action |
| --- | --- |
| type | edit |
| arrows, Home, End, PageUp, PageDown | move |
| Enter | new line, with auto-indent |
| Tab | indent to the next tab stop |
| Backspace, Delete | delete |
| Ctrl-F | find as you type |
| Ctrl-P | fuzzy file finder |
| Ctrl-O | open by path |
| Ctrl-K | cut line |
| Ctrl-U | paste line |
| Ctrl-S | save (asks for a name if new) |
| Ctrl-Z | undo |
| Ctrl-R | redo |
| Ctrl-Q | quit |

## Notes

- Always in typing mode, like nano.
- Tabs are preserved and shown at 4-column stops.
- A file without a trailing newline stays that way. The status bar says `no newline`.
- Large files re-highlight fully on every edit. Normal files stay fast.
- Wide characters (CJK) and long wrapped lines are not fully supported yet.

## Development

```bash
git clone https://github.com/mukundzha/grass.git
cd grass
pip install -e .
python tests/run_tests.py
```

Tests are plain functions with a small custom runner. CI runs on Python 3.9
through 3.13.

## License

MIT. See [LICENSE](https://github.com/mukundzha/grass/blob/main/LICENSE).

Issues and PRs are welcome.
