From 82d7392c5ca2632efc17169b5e97852c282ec6b2 Mon Sep 17 00:00:00 2001 From: Samir Benmendil Date: Thu, 16 Apr 2015 02:31:58 +0100 Subject: [PATCH] zsh: add toggle-sort option to fzf --- zsh/lib/fzf.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 -- 2.48.1