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):

  1. File Paths: Unix-style paths, including relative paths.
  2. Git: SHAs (short and long), diff headers (a/..., b/...).
  3. Network: IPv4, IPv6, MAC addresses.
  4. Web: HTTP/HTTPS URLs, Markdown links [txt](url).
  5. Docker: Image SHAs (sha256:...).
  6. Kubernetes: UIDs.
  7. Colors: Hex color codes (e.g., #ff0000).
  8. Numbers: 4+ digit numbers (often IDs or ports).
  9. Hex Numbers: 0x... format.
  10. 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.