Skip to main content

Config-driven parser for keybindings with fzf interface

Project description

confhelp

PyPI Python CI License: MIT

Find and edit your keybindings instantly.

demo

The Problem

Over time you accumulate tmux bindings, zsh aliases, vim mappings, custom functions - scattered across dozens of files. You know you set something up, but where?

Two pain points:

  1. Finding bindings - "What key did I bind for git status?" "Do I have an alias for docker compose?"
  2. Editing bindings - You remember it exists, now you need to change it. Which file? What line? grep → open → scroll → find → edit. Every. Single. Time.

The Solution

confhelp -b ~/dotfiles --edit

Fuzzy search all your bindings → select one → opens $EDITOR at exact file:line. No grepping, no scrolling, no hunting.

Install

pip install confhelp

Usage

# Output all bindings (uses base_dirs from config)
confhelp

# Interactive fzf selection
confhelp --select

# Select and open in $EDITOR at line
confhelp --edit

# JSON output
confhelp -f json

# Override base directory
confhelp -b ~/other-dotfiles

Example output:

[tmux]   prefix+g   display-popup -w 80%...   .tmux.conf:42
[alias]  gs         git status                .zsh_aliases:15
[bind]   ^[e        edit-command-line         .zshrc:89

The --edit flag drops you directly into the file at the exact line. Change the binding, save, done.

Config Format

Define parsers in TOML. Each section describes how to extract bindings from a set of files:

# Default directories to search (no -b needed)
base_dirs = ["~/dotfiles", "~/work-dotfiles"]

[tmux]
paths = [".tmux.conf"]
match_line = "^bind"
regex = 'bind(?:-key)?\s+(?:-n\s+)?(\S+)(.*)'
key_group = 1
desc_group = 2
type = "tmux"
truncate = 100

[alias]
paths = [".zsh_aliases", ".zsh_claude"]
regex = "alias\\s+(?:-[gs]\\s+)?([^=]+)=(.*)"
key_group = 1
desc_group = 2
type = "alias"
strip_quotes = true

[abbrev]
paths = [".zsh_abbreviations"]
mode = "abbrev_block"
type = "abbrev"

[nvim]
paths = [".config/nvim/lua/**/*.lua"]  # glob pattern
match_line = "vim.keymap.set"
regex = 'vim\.keymap\.set\([^,]+,\s*"([^"]+)".*desc\s*=\s*"([^"]+)"'
key_group = 1
desc_group = 2
type = "nvim"

Config Options

Option Description
paths List of files or glob patterns (e.g., **/*.lua)
regex Pattern with capture groups for key/desc
key_group Capture group number for the key
desc_group Capture group number for description
match_line Only process lines matching this pattern
skip_comment Skip lines starting with #
truncate Max length for description
strip_quotes Remove surrounding quotes from desc
desc_literal Use fixed string as description
desc_from_comment Extract desc from trailing # comment
mode Special modes: abbrev_block for zsh abbreviations

Output Formats

  • pipe (default): pipe-delimited [type]|key|desc|file:line
  • tsv: Tab-separated
  • json: JSON array

The pipe format works well with column -t -s'|' for aligned display.

Integration Examples

confhelp outputs text. How you display it is up to you.

Alacritty Popup

Spawn a centered popup window showing bindings. Enter jumps to the file:

selection=$(confhelp -b ~/dotfiles | column -t -s'|' | fzf)
# parse selection, open in editor

See examples/alacritty-popup.sh for a complete implementation.

tmux Popup

tmux display-popup -w 80% -h 80% -E 'confhelp -b ~/dotfiles --select'

See examples/tmux-popup.sh for a complete implementation.

Rofi/dmenu

confhelp -b ~/dotfiles | rofi -dmenu

Acknowledgments

Inspired by Extracto.

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

confhelp-0.4.0.tar.gz (254.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

confhelp-0.4.0-py3-none-any.whl (8.0 kB view details)

Uploaded Python 3

File details

Details for the file confhelp-0.4.0.tar.gz.

File metadata

  • Download URL: confhelp-0.4.0.tar.gz
  • Upload date:
  • Size: 254.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for confhelp-0.4.0.tar.gz
Algorithm Hash digest
SHA256 42039141604ab0b726add736c3931d01f2426eeb43985d9cba3431abfa8d1312
MD5 b6c87b30725d8ac602770dafba511e35
BLAKE2b-256 749ce97d2b0242ed0ecb9cd173fa7450b62e59883f3ac9f423d50ac0e43aa2cb

See more details on using hashes here.

Provenance

The following attestation bundles were made for confhelp-0.4.0.tar.gz:

Publisher: publish.yml on Piotr1215/confhelp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file confhelp-0.4.0-py3-none-any.whl.

File metadata

  • Download URL: confhelp-0.4.0-py3-none-any.whl
  • Upload date:
  • Size: 8.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for confhelp-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ec01a49819036bfeb395b179f9aaa84e6bd47bd12b0b2932c7c8cdc4f20eae61
MD5 efeb85cd0facddef07b678c8b1da3491
BLAKE2b-256 53284f22c1bf90b4808e630fe20f532c652f03f73b96c6172f23d5b06326e181

See more details on using hashes here.

Provenance

The following attestation bundles were made for confhelp-0.4.0-py3-none-any.whl:

Publisher: publish.yml on Piotr1215/confhelp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page