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:
gistoryTo start directly in the bookmarks list:
gistory --bookmarks- 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
__gistory() {
history -w
local selected
selected=$(gistory)
if [ -n "$selected" ]; then
history -s "$selected" # Add to history
eval "$selected" # Execute immediately
fi
}
[[ $- == *i* ]] && bind -x '"\C-r": __gistory'# Bind Ctrl+R to gistory - insert into readline buffer
__gistory() {
history -w
local selected
selected=$(gistory)
if [ -n "$selected" ]; then
READLINE_LINE="$selected"
READLINE_POINT=${#READLINE_LINE}
fi
}
[[ $- == *i* ]] && bind -x '"\C-r": __gistory'After adding this, reload your bashrc:
source ~/.bashrcNow pressing Ctrl+R will launch gistory instead of the default reverse search!
To launch gistory straight into the bookmarks list (using the --bookmarks flag), bind it to Ctrl+B. You can keep your Ctrl+R binding for normal history search at the same time.
# Bind Ctrl+B to gistory --bookmarks - auto-execute selected bookmark
__gistory_bookmarks() {
history -w
local selected
selected=$(gistory --bookmarks)
if [ -n "$selected" ]; then
history -s "$selected" # Add to history
eval "$selected" # Execute immediately
fi
}
[[ $- == *i* ]] && bind -x '"\C-b": __gistory_bookmarks'# Bind Ctrl+B to gistory --bookmarks - insert into readline buffer
__gistory_bookmarks() {
history -w
local selected
selected=$(gistory --bookmarks)
if [ -n "$selected" ]; then
READLINE_LINE="$selected"
READLINE_POINT=${#READLINE_LINE}
fi
}
[[ $- == *i* ]] && bind -x '"\C-b": __gistory_bookmarks'After adding (or updating) your bindings, reload your bashrc:
source ~/.bashrc- 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