From 0f0cc7e0d1bb5165d3b94566a417ff2e99e94075 Mon Sep 17 00:00:00 2001 From: Jason Hilder Date: Fri, 20 Mar 2026 10:46:26 +0200 Subject: [PATCH] Implement FZF command based on project.godot presence Add FZF project-aware command to update default command based on project presence. --- config/fish/config.fish | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/config/fish/config.fish b/config/fish/config.fish index d1bc5e5..b20d464 100644 --- a/config/fish/config.fish +++ b/config/fish/config.fish @@ -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