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.
On Ubuntu or Debian-based systems:
sudo apt install python3 python3-gi gir1.2-gtk-3.0 gir1.2-gtksource-4Some older systems package GtkSourceView 3 instead of 4:
sudo apt install gir1.2-gtksource-3.0For packaging validation:
sudo apt install appstream desktop-file-utils./twig.py
./twig.py path/to/file.pysudo make installInstall somewhere else:
make install PREFIX="$HOME/.local"Uninstall:
sudo make uninstallBuild a Debian package:
make debBuild the Flatpak for Flathub testing:
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.twigThe Flatpak manifest expects the v0.1.1 tag to exist on
https://github.com/patx/twig.git before it is submitted to Flathub.
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 |