From 651fc3426e1bdd18f9410b86a50049c566ff32db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=2E=20Fernando=20S=C3=A1nchez?= Date: Wed, 6 May 2020 18:01:32 +0200 Subject: [PATCH] add default completion zsh zfz --- .gitmodules | 3 --- zsh/.zprezto-contrib/fzf-tab | 1 - zsh/.zshrc | 23 ++++++++++++++++++++++- 3 files changed, 22 insertions(+), 5 deletions(-) delete mode 160000 zsh/.zprezto-contrib/fzf-tab diff --git a/.gitmodules b/.gitmodules index f39b14c..0d786b9 100644 --- a/.gitmodules +++ b/.gitmodules @@ -14,6 +14,3 @@ [submodule "zsh/.zprezto-contrib/fzf-z"] path = zsh/.zprezto-contrib/fzf-z url = git@github.com:andrewferrier/fzf-z.git -[submodule "zsh/.zprezto-contrib/fzf-tab"] - path = zsh/.zprezto-contrib/fzf-tab - url = https://github.com/Aloxaf/fzf-tab diff --git a/zsh/.zprezto-contrib/fzf-tab b/zsh/.zprezto-contrib/fzf-tab deleted file mode 160000 index 607a28b..0000000 --- a/zsh/.zprezto-contrib/fzf-tab +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 607a28b8950a152e3e799799c45c1110d10e680f diff --git a/zsh/.zshrc b/zsh/.zshrc index a009cb2..0090d76 100644 --- a/zsh/.zshrc +++ b/zsh/.zshrc @@ -15,6 +15,27 @@ if [[ -s "${ZDOTDIR:-$HOME}/.zprezto/init.zsh" ]]; then source "${ZDOTDIR:-$HOME}/.zprezto/init.zsh" fi +if [[ -s "/usr/share/fzf/key-bindings.zsh" ]]; then + source "/usr/share/fzf/key-bindings.zsh" + source "/usr/share/fzf/completion.zsh" +fi + + +# Change find to fd in fzf + +if command -v fd > /dev/null 2>&1; then + +_fzf_compgen_path() { + fd --hidden --follow --exclude ".git" . "$1" +} + +# Use fd to generate the list for directory completion +_fzf_compgen_dir() { + fd --type d --hidden --follow --exclude ".git" . "$1" +} + +fi + # Customize to your needs... # @@ -168,4 +189,4 @@ setopt interactivecomments export WASMTIME_HOME="$HOME/.wasmtime" -export PATH="$WASMTIME_HOME/bin:$PATH" \ No newline at end of file +export PATH="$WASMTIME_HOME/bin:$PATH"