summary refs log tree commit diff stats
path: root/tag-zsh
diff options
context:
space:
mode:
authorAlan Pearce2017-01-17 15:42:02 +0100
committerAlan Pearce2017-01-17 15:42:02 +0100
commitb08f6fb6ee6592db030f3f72d97ef291d1ce2d4c (patch)
tree5c1b41d14af0a8690f8c297a4ec55ed44e62cd17 /tag-zsh
parent966c4b9ab78499f82ff467a4e330d0966feb6784 (diff)
downloadnixfiles-b08f6fb6ee6592db030f3f72d97ef291d1ce2d4c.tar.lz
nixfiles-b08f6fb6ee6592db030f3f72d97ef291d1ce2d4c.tar.zst
nixfiles-b08f6fb6ee6592db030f3f72d97ef291d1ce2d4c.zip
Fix fzf completion
Diffstat (limited to 'tag-zsh')
-rw-r--r--tag-zsh/config/zsh/zshrc19
1 files changed, 18 insertions, 1 deletions
diff --git a/tag-zsh/config/zsh/zshrc b/tag-zsh/config/zsh/zshrc
index 80068eb5..86f1b54d 100644
--- a/tag-zsh/config/zsh/zshrc
+++ b/tag-zsh/config/zsh/zshrc
@@ -5,7 +5,7 @@ zplug "zsh-users/zsh-completions", depth:1, defer:0
 zplug "Tarrasch/zsh-autoenv", as:plugin
 zplug "clvv/fasd", hook-build:"PREFIX=$HOME make install"
 zplug "junegunn/fzf-bin", from:gh-r, as:command, rename-to:fzf
-zplug "junegunn/fzf", as:plugin, use:"shell/*.zsh"
+zplug "junegunn/fzf", as:plugin, use:"shell/*.zsh", defer:2
 zplug "junegunn/fzf", as:command, use:"bin/*"
 zplug "caarlos0/zsh-open-pr", as:plugin
 if [[ -n $commands[nix-env] ]]
@@ -231,6 +231,23 @@ else
   precmd_functions+=(update_window_title)
 fi
 
+if zplug check junegunn/fzf
+then
+  _fzf_compgen_path() {
+    echo "$1"
+    command find -L "$1" \
+            -name .git -prune -o -name .svn -prune -o \( -type d -o -type f -o -type l \) \
+            -a -not -path "$1" -print 2> /dev/null | sed 's@^\./@@'
+  }
+
+  _fzf_compgen_dir() {
+    command find -L "$1" \
+            -name .git -prune -o -name .svn -prune -o -type d \
+            -a -not -path "$1" -print 2> /dev/null | sed 's@^\./@@'
+  }
+fi
+
+
 if zplug check clvv/fasd
 then
   if [[ -n $commands[fasd] ]]