patx/twig
Lightweight, ultra minimal GTK code editor for Linux with syntax highlighting, line numbers, one-window-per-file editing, find/replace, automatic indent, and keyboard-driven controls. Official Website.
$ git clone https://gitman.io/git/patx/twig
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:
sudo apt install python3 python3-gi gir1.2-gtk-3.0 gir1.2-gtksource-4
Some older systems package GtkSourceView 3 instead of 4:
sudo apt install gir1.2-gtksource-3.0
Run
./twig.py
./twig.py path/to/file.py
Install
sudo make install
Install somewhere else:
make install PREFIX="$HOME/.local"
Uninstall:
sudo make uninstall
Build a Debian package:
make deb
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 |
|
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 |