X-Git-Url: https://git.rmz.io/dotfiles.git/blobdiff_plain/f7386c50e4c2d2330c7d4fe3c0992911e01be971..c20554a13a4689f821cf17bb78a422dbd6d9a050:/zsh/lib/fzf.zsh diff --git a/zsh/lib/fzf.zsh b/zsh/lib/fzf.zsh index 7341504..fdeb0b8 100755 --- a/zsh/lib/fzf.zsh +++ b/zsh/lib/fzf.zsh @@ -57,7 +57,7 @@ bindkey '\ec' fzf-cd-widget # CTRL-R - Paste the selected command from history into the command line fzf-history-widget() { local selected - if selected=$(fc -l 1 | fzf -x +s --tac +m -n2..,.. -q "$LBUFFER"); then + if selected=$(fc -l 1 | fzf -x +s --tac +m -n2..,.. --toggle-sort=ctrl-r -q "$LBUFFER"); then num=$(echo "$selected" | head -1 | awk '{print $1}' | sed 's/[^0-9]//g') LBUFFER=!$num zle expand-history