123456789101112131415 |
- export FZF_DEFAULT_OPTS="--layout=reverse"
- fzf_history() {
- local selected=$(sed 's/^[^;]*;//' $HISTFILE | \
- 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)
- local ret=$?
- if [ -n "$selected" ]; then
- BUFFER="$selected"
- fi
- zle reset-prompt
- return $ret
- }
- zle -N fzf_history
|