]> git.rmz.io Git - dotfiles.git/blobdiff - zsh/lib/fzf.zsh
xdg: add user-dirs.dirs
[dotfiles.git] / zsh / lib / fzf.zsh
index 7341504af551f8f5b1b9c1487c57bb8fc0cf7cf4..6f0b81ff3062166f31451012be720cb6e490bc8b 100755 (executable)
@@ -47,7 +47,7 @@ bindkey '^T' fzf-file-widget
 
 # ALT-C - cd into the selected directory
 fzf-cd-widget() {
-  cd "${$(command find -L . \( -path '*/\.*' -o -fstype 'dev' -o -fstype 'proc' \) -prune \
+  cd "${$(command find -L . -xdev \( -path '*/\.*' -o -fstype 'dev' -o -fstype 'proc' \) -prune \
     -o -type d -print 2> /dev/null | sed 1d | cut -b3- | fzf +m):-.}"
   zle reset-prompt
 }
@@ -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