https://github.com/patx/twig
Twig is an ultra-minimal GTK3 code editor for Linux
https://github.com/patx/twig
code-edit code-editing code-editor editor ide text-editing text-editor text-editors
Last synced: about 15 hours ago
JSON representation
Twig is an ultra-minimal GTK3 code editor for Linux
- Host: GitHub
- URL: https://github.com/patx/twig
- Owner: patx
- License: mit
- Created: 2026-06-14T14:41:30.000Z (about 1 month ago)
- Default Branch: main
- Last Pushed: 2026-06-14T14:51:16.000Z (about 1 month ago)
- Last Synced: 2026-06-14T16:47:01.771Z (about 1 month ago)
- Topics: code-edit, code-editing, code-editor, editor, ide, text-editing, text-editor, text-editors
- Language: Python
- Homepage: https://harrisonerd.com/twig
- Size: 811 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Twig
Twig is a small GTK code editor intended for lightweight Linux.
It focuses on the basics: one file per window, open/save,
syntax highlighting, line numbers, find/replace, undo/redo, dirty indicators,
and save-before-close prompts.
## Dependencies
On Ubuntu or Debian-based systems:
```sh
sudo apt install python3 python3-gi gir1.2-gtk-3.0 gir1.2-gtksource-4
```
Some older systems package GtkSourceView 3 instead of 4:
```sh
sudo apt install gir1.2-gtksource-3.0
```
For packaging validation:
```sh
sudo apt install appstream desktop-file-utils
```
## Run
```sh
./twig.py
./twig.py path/to/file.py
```
## Install
```sh
sudo make install
```
Install somewhere else:
```sh
make install PREFIX="$HOME/.local"
```
Uninstall:
```sh
sudo make uninstall
```
Build a Debian package:
```sh
make deb
```
Build the Flatpak for Flathub testing:
```sh
flatpak install --user flathub org.flatpak.Builder
flatpak run org.flatpak.Builder --force-clean --user --install --install-deps-from=flathub build-dir io.github.patx.twig.yml
flatpak run io.github.patx.twig
```
The Flatpak manifest expects the `v0.1.1` tag to exist on
`https://github.com/patx/twig.git` before it is submitted to Flathub.
## Shortcuts
Twig intentionally has no toolbar or menu bar. Use these keyboard shortcuts:
| Shortcut | Action |
| --- | --- |
| `Ctrl+N` or `Ctrl+T` | Open a new empty editor window |
| `Ctrl+O` | Open one or more files |
| `Ctrl+S` | Save the current file |
| `Ctrl+Shift+S` | Save the current file as a new path |
| `Ctrl+W` | Close the current window |
| `Ctrl+P` | Print |
| `Ctrl+Q` | Quit Twig, prompting for unsaved files |
| `Ctrl+Z` | Undo |
| `Ctrl+Shift+Z` | Redo |
| `Ctrl+X` | Cut |
| `Ctrl+C` | Copy |
| `Ctrl+V` | Paste |
| `Ctrl+A` | Select all |
| `Ctrl+D` | Delete the selected lines or current line |
| `Ctrl+F` | Open or focus Find and Replace |
| `Ctrl+G` | Find next match |
| `Ctrl+Shift+G` | Find previous match |
| `Ctrl+R` | Open Find and Replace with the replace field focused |
| `Ctrl+J` | Jump to line |
| `Ctrl++` | Increase editor font size |
| `Ctrl+-` | Decrease editor font size |
| `Tab` with selected lines | Indent selected lines with spaces |
| `Shift+Tab` with selected lines | Unindent selected lines |
| `Enter` in Find | Find next match |
| `Enter` in Replace | Replace current match |