Themes and Hints Kittens
The themes and hints kittens solve two common needs: changing color schemes without editing config, and selecting visible text without using the mouse.
Learn to switch color themes interactively and use hint-based text selection to open URLs, copy paths, and build custom actions.
Themes Kitten
The themes kitten lets you browse, preview, and apply color themes interactively.
Basic Usage
# Open the interactive theme browser
kitty +kitten themes
A TUI opens showing available themes grouped by category. Navigate with arrow keys, preview with Enter, and apply with Ctrl+c.
What You Can Do
| Action | How |
|---|---|
| Browse themes | Arrow keys to scroll |
| Preview theme | Highlight and press Enter |
| Apply theme | Press Ctrl+c on selected |
| Set as default | Answer "yes" when prompted |
| Search themes | Type to filter |
| View theme source | Mouse-over shows source URL |
Theme Storage
Applied themes are written to kitty.conf:
# The themes kitten adds or updates this line:
include themes/mytheme.conf
Themes are stored in ~/.config/kitty/themes/.
Creating a Custom Theme
Create a .conf file in ~/.config/kitty/themes/:
# My Custom Theme
foreground #dcdcdc
background #1a1b26
selection_foreground #ffffff
selection_background #7aa2f7
# Black
color0 #1d2021
color8 #928374
# Red
color1 #cc241d
color9 #fb4934
# Green
color2 #98971a
color10 #b8bb26
# Yellow
color3 #d79921
color11 #fabd2f
# Blue
color4 #458588
color12 #83a598
# Magenta
color5 #b16286
color13 #d3869b
# Cyan
color6 #689d6a
color14 #8ec07c
# White
color7 #a89984
color15 #ebdbb2
Then apply it:
kitty +kitten themes
# Search for "my-custom-theme" and select it
Automatic Light/Dark Switching
Use a cron job or systemd timer:
#!/bin/bash
HOUR=$(date +%H)
THEME_DIR="$HOME/.config/kitty/themes"
if [ "$HOUR" -ge 6 ] && [ "$HOUR" -lt 18 ]; then
THEME="catppuccin-latte.conf" # light
else
THEME="catppuccin-mocha.conf" # dark
fi
kitty @ set-colors --all "$THEME_DIR/$THEME"
Hints Kitten
The hints kitten selects visible text by matching patterns. It overlays each match with a keyboard shortcut, letting you act on it.
Basic Usage
# Select a URL from visible terminal output
kitty +kitten hints
# Select a file path
kitty +kitten hints --type path
# Select any text matching a regex
kitty +kitten hints --customize '[A-Z]+_\d+' --program 'echo {}'
# Open the selected text with a program
kitty +kitten hints --type path --program vim
The kitten parses all visible text, finds matches for the pattern, assigns each a keyboard shortcut, and lets you press that shortcut to act on the match.
Hint Types
| Type | Matches | Default Action |
|---|---|---|
url | HTTP/HTTPS/FTP URLs | Open in browser |
path | File system paths | Open path |
hash | Git commit hashes | Copy hash |
line | Any line of text | Copy line |
word | Any word | Copy word |
numeric | Numbers | Copy number |
hyperlink | OSC 8 hyperlinks | Open hyperlink |
Custom Hint Patterns
# Match IP addresses and pipe to clipboard
kitty +kitten hints --customize '\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}' --program 'xclip -selection clipboard'
# Match error codes and open docs
kitty +kitten hints --customize 'E[0-9]{4}' --program 'open "https://example.com/errors/{}"'
# Match Docker container IDs
kitty +kitten hints --customize '[a-f0-9]{12}' --program 'docker inspect {}'
Hints Configuration in kitty.conf
# Map hint kitten to a shortcut
map ctrl+shift+u kitten hints --type url
map ctrl+shift+p kitten hints --type path --program vim
map ctrl+shift+y kitten hints --type line
Hyperlinked Grep
The hyperlinked_grep kitten combines grep with clickable results:
# Search files and get clickable results
kitty +kitten hyperlinked_grep "search_term" /path/to/search
# With file type filter
kitty +kitten hyperlinked_grep --include '*.py' "def class" /src
# Case-insensitive search
kitty +kitten hyperlinked_grep -i "error" /var/log
Each result line is clickable — press the hinted key to open the file at the matching line.
Common Pitfalls
| Pitfall | Symptom | Fix |
|---|---|---|
| Themes kitten shows no themes | Empty list | Install theme collections or run kitty +kitten themes from a writable dir |
| Hint matches too many items | Overlapping keyboard shortcuts | Narrow the regex or use --type with a specific type |
| Hints not matching paths | Paths with spaces or special chars | Use --customize with an escaped regex |
| Hyperlinked grep very slow | Large search space | Add --include or --exclude to limit scope |
| Theme not persisting after restart | Theme not saved to config | When prompted "Set as default?", answer "yes" |
Hands-On Practice
# Browse and apply a theme
kitty +kitten themes
# Practice hints on visible URLs
echo "Visit https://example.com and https://kitty.app for more info"
# Now run: kitty +kitten hints --type url
# Press the displayed key to open a URL
# Custom hint for hex colors
echo "Colors: #ff5733 #33ff57 #3357ff"
kitty +kitten hints --customize '#[0-9a-fA-F]{6}' --program 'echo "Selected: {}"'
# Hyperlinked grep
mkdir -p /tmp/testgrep
echo -e "line one\nerror: something broke\nline three" > /tmp/testgrep/test.log
kitty +kitten hyperlinked_grep "error" /tmp/testgrep
rm -rf /tmp/testgrep