Implement FZF command based on project.godot presence

Add FZF project-aware command to update default command based on project presence.
This commit is contained in:
Jason Hilder 2026-03-20 10:46:26 +02:00 committed by GitHub
parent 73322020cb
commit 0f0cc7e0d1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 15 additions and 0 deletions

View File

@ -203,3 +203,18 @@ set -g __fish_git_prompt_separator ' '
set -g __fish_git_prompt_char_dirtystate '+'
set -g __fish_git_prompt_char_stagedstate '●'
set -g __fish_git_prompt_char_untrackedfiles ''
# ==============================================================================
# FZF PROJECT-AWARE COMMAND
# ==============================================================================
function __fzf_update_cmd --on-variable PWD
if test -f project.godot; or test -f ../project.godot
set -gx FZF_DEFAULT_COMMAND 'fdfind --type f -e gd -e cs -e gdshader -e shader -e tscn -e tres -e cfg --exclude .godot --exclude .import'
else
set -gx FZF_DEFAULT_COMMAND 'fdfind --exclude={.git,.cache,.xmake,.zig-cache,build,tmp,node_modules,elpa} --type f -H'
end
end
# Run once on shell start
__fzf_update_cmd