Skip to content

patx/twig

Repository files navigation

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

For packaging validation:

sudo apt install appstream desktop-file-utils

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

Build 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.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

Contributors