From: Samir Benmendil Date: Thu, 16 Apr 2015 01:31:58 +0000 (+0100) Subject: zsh: add toggle-sort option to fzf X-Git-Url: https://git.rmz.io/dotfiles.git/commitdiff_plain/82d7392c5ca2632efc17169b5e97852c282ec6b2?ds=sidebyside zsh: add toggle-sort option to fzf --- 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