From 5c3869c9882181269ef6b75d11c568c14d740482 Mon Sep 17 00:00:00 2001 From: clux Date: Mon, 22 Jul 2024 00:25:25 +0100 Subject: [PATCH] fzf: use fd for ** completion Signed-off-by: clux --- .zshenv | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/.zshenv b/.zshenv index 95db4ce..96cdb0d 100755 --- a/.zshenv +++ b/.zshenv @@ -10,14 +10,15 @@ export MANROFFOPT='-c' # https://github.com/sharkdp/bat/issues/2593 # openkeychain compat export PASSWORD_STORE_GPG_OPTS='--no-throw-keyids' -# fzf should ony show non-build files when browsing git repos -# Verify with echo $FZF_DEFAULT_COMMAND | sh | fzf -export FZF_DEFAULT_COMMAND=' - (git ls-tree -r --name-only HEAD || - find . -type f -print -o -type l -print | - grep -vE "/target/|node_modules|bower_components|venv\/|.git/" | - sed s/^..//) 2> /dev/null' +# fzf for file search should exclude git ignored files +export FZF_DEFAULT_COMMAND="fd --strip-cwd-prefix -HE='.git'" +export FZF_ALT_C_COMMAND="fd --type d --strip-cwd-prefix -HE='.git'" +# for tab completion on ** +_fzf_compgen_path() { fd -HE='.git' . "$1"; } +_fzf_compgen_gir() { fd --type=d -HE='.git' . "$1"; } _FZF_LAYOUT='--height 50% --layout=reverse' +eval "$(fzf --zsh)" + # fzf theme; catppuccin mocha: https://github.com/catppuccin/fzf but no bg export FZF_DEFAULT_OPTS="${_FZF_LAYOUT} \ --color=spinner:#f5e0dc,hl:#f38ba8 \