Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mollifier/a2a17c397d8a2bb9e513 to your computer and use it in GitHub Desktop.
Save mollifier/a2a17c397d8a2bb9e513 to your computer and use it in GitHub Desktop.
if which peco &> /dev/null; then
function peco_select_history() {
BUFFER=$(fc -l -n -r 1 | \
peco --layout=bottom-up --query "$LBUFFER")
CURSOR=$#BUFFER # move cursor
zle -R -c # refresh
}
zle -N peco_select_history
bindkey '^R' peco_select_history
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment