Pattern Matching
tmux-thumbs uses Regular Expressions to identify interactable items on your screen.
Built-in Patterns
The following patterns are enabled by default (defined in src/state.rs):
- File Paths: Unix-style paths, including relative paths.
- Git: SHAs (short and long), diff headers (
a/...,b/...). - Network: IPv4, IPv6, MAC addresses.
- Web: HTTP/HTTPS URLs, Markdown links
[txt](url). - Docker: Image SHAs (
sha256:...). - Kubernetes: UIDs.
- Colors: Hex color codes (e.g.,
#ff0000). - Numbers: 4+ digit numbers (often IDs or ports).
- Hex Numbers:
0x...format. - IPFS: CIDs.
Custom Patterns
You can add your own Regex patterns using the @thumbs-regexp-N configuration options in .tmux.conf. You can define multiple patterns by incrementing the number.
Note: Rust's regex engine is used. You may need to escape backslashes.
Examples
1. Match Email Addresses:
set -g @thumbs-regexp-1 '[\w-\.]+@([\w-]+\.)+[\w-]{2,4}'
2. Match VLAN Interfaces:
set -g @thumbs-regexp-2 'Vlan\d+'
3. Match Specific Error Codes:
set -g @thumbs-regexp-3 'Error: [0-9]+'
Excluded Patterns
By default, tmux-thumbs ignores bash ANSI color codes to prevent visual glitches during highlighting.