]> git.rmz.io Git - dotfiles.git/commitdiff
zsh: add toggle-sort option to fzf
authorSamir Benmendil <samir.benmendil@gmail.com>
Thu, 16 Apr 2015 01:31:58 +0000 (02:31 +0100)
committerSamir Benmendil <samir.benmendil@gmail.com>
Thu, 16 Apr 2015 01:31:58 +0000 (02:31 +0100)
zsh/lib/fzf.zsh

index 7341504af551f8f5b1b9c1487c57bb8fc0cf7cf4..fdeb0b858003d89fd9c65af9bac50877b1de75ac 100755 (executable)
@@ -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