Skip to content

Instantly share code, notes, and snippets.

@siriusjack
Last active January 11, 2018 05:01
Show Gist options
  • Save siriusjack/fd4236370357ef7a583b2ce9499ed02c to your computer and use it in GitHub Desktop.
Save siriusjack/fd4236370357ef7a583b2ce9499ed02c to your computer and use it in GitHub Desktop.
fzf-history integration for zsh
function history-fzf() {
BUFFER=$(history -n -r 1 | fzf --no-sort +m --query "$LBUFFER" --prompt="History > ")
CURSOR=$#BUFFER
zle reset-prompt
}
zle -N history-fzf
bindkey '^r' history-fzf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment