https://github.com/ivanjermakov/hat
Hackable modal text editor for modern terminals
https://github.com/ivanjermakov/hat
lsp suckless text-editor tree-sitter
Last synced: 25 days ago
JSON representation
Hackable modal text editor for modern terminals
- Host: GitHub
- URL: https://github.com/ivanjermakov/hat
- Owner: ivanjermakov
- License: mit
- Created: 2025-05-23T17:56:49.000Z (about 1 year ago)
- Default Branch: master
- Last Pushed: 2025-10-27T11:53:15.000Z (8 months ago)
- Last Synced: 2025-10-27T13:29:01.897Z (8 months ago)
- Topics: lsp, suckless, text-editor, tree-sitter
- Language: Zig
- Homepage:
- Size: 1.9 MB
- Stars: 7
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
# Hat
Hat is a **ha**ckable modal **t**ext editor for modern terminals.
|  |  |
|-----------------------------|-----------------------------|
|  |  |
## Features
### Core functionality
- Modal text editing
* Normal, select, select line, and insert modes
* Basic motions (vim's `e` `y` `o` `p` `a` `d` `D` `f` `c` `C` `b` `^` `$` `0` `=` `J` `gJ` `*` `#` etc.)
* Unlimited undo/redo
* System clipboard copy & paste (using `xclip`)
* Find in buffer
- Text automation
* Run external command on selection
* Dot repeat last change
* Multi repeat
* Macros
- [Tree-sitter](https://tree-sitter.github.io/tree-sitter/) syntax awareness
* Syntax highlighting (24 bit color)
* Indent alignment
- [LSP](https://microsoft.github.io/language-server-protocol/) support
* Go to definition
* Find references
* Diagnostics
* Completions w/ documentation
* Hover
* Rename
- Multi buffer
* Buffer management
* Find file
* Find in files
- Scratch buffers
- Unicode support
- `--printer` mode
### Functionality available in patches
| Done | Name | Link |
| ---- | ------------------------ | ----------------------------------------------------- |
| ✔️ | LSP highlight | [patch/lsp-highlight](/patch/lsp-highlight) |
| ✔️ | LSP code action | [patch/lsp-code-action](/patch/lsp-code-action) |
| ✔️ | LSP formatting | [patch/lsp-formatting](/patch/lsp-formatting) |
| ✔️ | Git hunk markers | [patch/git-signs](/patch/git-signs) |
| ✔️ | Tree-sitter symbol picker | [patch/ts-symbol-picker](/patch/ts-symbol-picker) |
| ✔️ | Buffer centering | [patch/buffer-centering](/patch/buffer-centering) |
| ✔️ | Autosave | [patch/autosave](/patch/autosave) |
| ✔️ | Relative line numbers | [patch/relative-number](/patch/relative-number) |
| ✔️ | Auto-indent | [patch/auto-indent](/patch/auto-indent) |
| 🚧 | Windows support | |
| 🚧 | MacOS support | |
| 🚧 | Wayland support | |
| 🚧 | Persistent undo | |
| 🚧 | Persistent macros | |
| 🚧 | Surround actions | |
| 🚧 | Case actions | |
| 🚧 | Marks | |
| 🚧 | Comments | |
| 🚧 | List mode (fill chars) | |
## Philosophy
Software is:
- doing not more and not less than what the user needs
* Every feature is implemented in the most simple and straightforward form: keep it simple, fast, and clear
- made for users capable of reading and customizing its source code
* Source code can be read by users in one evening
* External configuration is not necessary and discouraged
* User manual documentation is not necessary, _hacking_ documentation is encouraged (via [`HACKING.md`](HACKING.md))
- distributed as source code, compiled by the user
- not meant to be developed forever and its final state should be described by its feature set from
the beginning
- extended either by the user directly, or by applying [source code patches](https://en.wikipedia.org/wiki/Patch_(computing)#Source_code_patching)
distributed as diff files
* It is encouraged to share your extensions with others who can find it useful
See [Hackable software](http://blog.ivnj.org/post/hackable-software.html) for details.
## Build, install, usage, configuration
See [`HACKING.md`](HACKING.md).
## Contributing
See [`CONTRIBUTING.md`](CONTRIBUTING.md).