Skip to content

Commit

Permalink
fzf: use fd for ** completion
Browse files Browse the repository at this point in the history
Signed-off-by: clux <[email protected]>
  • Loading branch information
clux committed Jul 21, 2024
1 parent 1823cbb commit 5c3869c
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions .zshenv
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down

0 comments on commit 5c3869c

Please sign in to comment.