giallo.kak
Kakoune integration for the giallo TextMate highlighter.
Demo
Installation
From GitHub Releases (Recommended)
Download pre-built binaries from the Releases page:
# Linux x86_64
# macOS
# Make executable
Build from Source
# 1. Clone this repository
# 2. Clone giallo dependency (required for the builtin dump)
# 3. Generate the builtin dump (or use the provided one)
# 4. Copy dump back and build
The binary will be at target/release/giallo-kak.
Usage
Add to your Kakoune kakrc:
evaluate-commands %sh{
giallo-kak init
}
Or source the script directly:
source /path/to/giallo.kak/rc/giallo.kak
- Enable per-buffer (or it auto-enables for buffers with filetype):
giallo-enable
- Set a theme:
giallo-set-theme kanagawa-wave
Custom Grammars
giallo.kak supports dynamic loading of custom TextMate grammars without rebuilding. Simply place your grammar files in a directory and configure the path in your config.
Quick Setup
- Create a grammars directory:
-
Download grammar files (.json or .plist) from:
- VSCode extensions
- shikijs/textmate-grammars-themes
- Any TextMate/VSCode grammar repository
-
Configure the grammars path in
~/.config/giallo.kak/config.toml:
# Path to your custom grammars directory
= "~/.config/giallo.kak/grammars"
# Map Kakoune filetypes to grammar IDs
[]
= "terraform"
= "terraform"
- Restart Kakoune - grammars are loaded automatically on startup
Advanced: Custom Grammar Aliases
Grammar files can define aliases in their metadata. For example, a terraform.json grammar with "aliases": ["tf", "hcl"] will automatically be available for those filetypes. You can also manually map filetypes using language_map in config.
Custom Themes
Just like grammars, giallo.kak supports dynamic loading of custom TextMate themes without rebuilding.
Quick Setup
- Create a themes directory:
-
Download theme files (.json) from:
- VSCode extensions
- shikijs/textmate-grammars-themes
- Any TextMate/VSCode theme repository
-
Configure the themes path in
~/.config/giallo.kak/config.toml:
# Path to your custom themes directory
= "~/.config/giallo.kak/themes"
- Use your custom theme:
giallo-set-theme my-custom-theme
Building Custom Registry (Advanced)
For maximum control, you can still build a custom registry dump:
use Registry;
Then replace the builtin dump and rebuild:
The registry API provides these methods:
Registry::add_grammar_from_path(path)- Add a grammar from a JSON/plist fileRegistry::link_grammars()- Resolve grammar dependencies (required after adding grammars)Registry::add_theme_from_path(path)- Add a theme from a JSON fileRegistry::save_to_file(path)- Save the compiled registry to a msgpack file
Config
Config file path:
$XDG_CONFIG_HOME/giallo.kak/config.toml, or~/.config/giallo.kak/config.toml
Example config:
# Default theme
= "kanagawa-wave"
# Filetype mapping
[]
= "shellscript"
= "javascript"
Available themes: kanagawa-wave, kanagawa-dragon, kanagawa-lotus, catppuccin-frappe, catppuccin-mocha, catppuccin-latte, tokyo-night, dracula, gruvbox-dark-medium, and many more (55 total themes).
See docs/config.example.toml for a fuller template.
CI/CD
This project uses GitHub Actions for automated builds and releases:
- Every push to main: Builds and tests on Linux, macOS, and Windows
- Tag pushes (v*): Creates GitHub releases with pre-built binaries
The CI process automatically:
- Clones the upstream giallo repository
- Generates the
builtin.msgpackdump - Builds for multiple platforms
- Creates releases with binaries attached
Notes
- The
giallobuiltin dump (builtin.msgpack) is required forRegistry::builtin(). - The dump is generated in the giallo repository via:
Special Thanks
Special thanks to:
- jdugan6240 from the Kakoune community Discord for sharing giallo and inspiring this Kakoune integration project
- kak-tree-sitter for the inspiration on the IPC architecture and FIFO-based communication pattern
- OpenAI Codex 5.2 and Kimi K2.5 for assistance in developing this project