fzf.zsh 426 B

123456789101112131415
  1. export FZF_DEFAULT_OPTS="--layout=reverse"
  2. fzf_history() {
  3. local selected=$(sed 's/^[^;]*;//' $HISTFILE | \
  4. FZF_DEFAULT_OPTS="--height ${FZF_TMUX_HEIGHT:-40%} $FZF_DEFAULT_OPTS --tiebreak=index --tac --bind=ctrl-r:toggle-sort,ctrl-z:ignore $FZF_CTRL_R_OPTS --query=${(qqq)LBUFFER} +m" fzf)
  5. local ret=$?
  6. if [ -n "$selected" ]; then
  7. BUFFER="$selected"
  8. fi
  9. zle reset-prompt
  10. return $ret
  11. }
  12. zle -N fzf_history