A fast, interactive replacement for bash's Ctrl+R reverse history search, built with Go and tview.
- Fuzzy search: Type anywhere in the command to find matches
- Interactive TUI: Real-time filtering as you type
- Deduplication: Shows only unique commands (most recent first)
- Go to the releases page
- Download the archive for your OS and architecture
- Extract and install:
tar xzf gistory_*.tar.gz
sudo mv gistory /usr/local/bin/go build -o gistory
sudo mv gistory /usr/local/bin/Or install to your local bin:
go build -o gistory
mkdir -p ~/bin
mv gistory ~/bin/
# Make sure ~/bin is in your PATHSimply run:
gistory- Type: Filter commands with fuzzy search
- Enter: Select current command (prints to stdout)
- Up/Down or Ctrl+P/Ctrl+N: Navigate through results
- Esc: Cancel and exit
To replace Ctrl+R with gistory, add this to your ~/.bashrc:
# Bind Ctrl+R to gistory - auto-execute selected command
bind -x '"\C-r": __gistory'
__gistory() {
history -w
local selected
selected=$(gistory)
if [ -n "$selected" ]; then
history -s "$selected" # Add to history
eval "$selected" # Execute immediately
fi
}# Bind Ctrl+R to gistory - insert into readline buffer
bind -x '"\C-r": __gistory'
__gistory() {
history -w
local selected
selected=$(gistory)
if [ -n "$selected" ]; then
READLINE_LINE="$selected"
READLINE_POINT=${#READLINE_LINE}
fi
}After adding this, reload your bashrc:
source ~/.bashrcNow pressing Ctrl+R will launch gistory instead of the default reverse search!
- Reads commands from
~/.bash_history - Deduplicates commands (keeps most recent)
- Provides interactive fuzzy search interface
- Outputs selected command to stdout
- Bash integration either executes it immediately or inserts it into your command line
- Go 1.16 or higher (for building)
- Bash with
bind -xsupport (most modern versions) - Terminal with color support
MIT