This document shows how to setup Recaller for Zsh shell.
Good news: Zsh works with Recaller out of the box! Zsh automatically includes timestamps in ~/.zsh_history when using the extended history format.
Recommended settings for optimal experience:
Add the following to your ~/.zshrc:
# Enable extended history format (recommended for Recaller)
setopt EXTENDED_HISTORY
# Optional: Increase history size for better search results
export HISTSIZE=10000
export SAVEHIST=20000
# Write history immediately after each command (recommended)
setopt INC_APPEND_HISTORYAfter adding the above to your ~/.zshrc:
# Reload your shell configuration
source ~/.zshrc
# Verify extended history is enabled (should show timestamps)
head ~/.zsh_historyAfter configuration, your ~/.zsh_history should contain entries like:
: 1692284400:0;ls -la
: 1692284405:0;git status
: 1692284410:0;recaller
This format includes timestamps (the number after the first colon) that Recaller uses for intelligent ranking.
Add this to your ~/.zshrc:
# Launch recaller with Ctrl+h
recall-run-widget() {
recaller
zle reset-prompt
}
zle -N recall-run-widget
bindkey '^h' recall-run-widgetFor advanced users who want inline history suggestions, install fzf and add this widget:
# macOS
brew install fzf
# Ubuntu/Debian
sudo apt install fzf
# Arch Linux
sudo pacman -S fzfAdd to your ~/.zshrc:
# Inline history suggestions with Ctrl+Alt+s
recaller-suggest-widget() {
local prefix="$LBUFFER"
local suggestions suggestion
suggestions=$(recaller history --match "$prefix")
if [[ -z "$suggestions" ]]; then
return 0
fi
suggestion=$(echo "$suggestions" | fzf --height 40% --reverse --prompt="History > ")
if [[ -n "$suggestion" ]]; then
LBUFFER="$suggestion"
CURSOR=${#LBUFFER}
fi
zle reset-prompt
}
zle -N recaller-suggest-widget
bindkey '^[^S' recaller-suggest-widgetSolution: Ensure you have run some commands in zsh first to populate ~/.zsh_history.
Solution: Enable EXTENDED_HISTORY in your ~/.zshrc for timestamp support.
Solution: Increase HISTSIZE and SAVEHIST values in your configuration.
Solution: Install fzf using your package manager and restart your shell.
If you're new to zsh or have a minimal setup:
# Essential zsh configuration for Recaller
echo 'setopt EXTENDED_HISTORY' >> ~/.zshrc
echo 'setopt INC_APPEND_HISTORY' >> ~/.zshrc
echo 'export HISTSIZE=10000' >> ~/.zshrc
echo 'export SAVEHIST=20000' >> ~/.zshrc
# Reload configuration
source ~/.zshrcNow Recaller should work optimally with your zsh history!