2 unstable releases
Uses new Rust 2024
new 0.4.0 | May 16, 2025 |
---|---|
0.3.3 | May 14, 2025 |
#2588 in Command line utilities
99 downloads per month
25KB
591 lines
Leadr
Leadr is a customizable CLI shortcut manager inspired by the leader key concept in (Neo)Vim. Use memorable key sequences to quickly execute or insert commands in your terminal.
⚡️ Requirements
- bash or zsh
- crossterm compatible terminal (see their Readme for a list)
Note: leadr
works best inside a tmux
session since it can utilize tmux
's send-keys
to execute commands.
Outside of tmux
, leadr
will fallback to eval
and manually appending the command to the shell's history.
📦 Installation
From pre-built binaries
You can download pre-built binaries from the releases page.
Just copy the binary to a directory in your PATH
, e.g. using the following command:
curl -L https://github.com/ll-nick/leadr/releases/latest/download/leadr -o ~/.local/bin/leadr
chmod +x ~/.local/bin/leadr
From crates.io
You can install leadr
using cargo:
cargo install leadr
This will install the latest version of leadr
from crates.io.
From source
You can build leadr
from source using cargo:
git clone https://github.com/ll-nick/leadr.git
cd leadr
cargo install --path .
🐚 Shell Integration
To use leadr
, simply add the following line to your shell configuration file (e.g. ~/.bashrc
or ~/.zshrc
):
# For bash
source <(leadr --bash)
# For zsh
source <(leadr --zsh)
🛠️ Configuration and Usage
leadr
will automatically create a configuration file and fill it with some default shortcuts the first time you run it.
See confy's Readme for the location of the configuration file.
For a list of all available commands, run:
leadr --list
With the default config, you can e.g. execute git status
by pressing <Ctrl-Space>
followed by gs
.
Similarly, you can pre-populate git commit -m "
by pressing <Ctrl-Space>
followed by gc
.
Modify the configuration file to add your own shortcuts or adjust the leadr
keybinding.
For a list of currently supported keybindings, see src/keymap.rs.
Dependencies
~4–18MB
~194K SLoC