ignore app-state in interactive file search

This commit is contained in:
Yan Lin 2026-01-25 08:44:31 +01:00
parent 52a05bfc53
commit 947157696b

View file

@ -92,17 +92,17 @@
function cdf() {
local search_dir="''${1:-~}"
local target
target=$(echo "" | fzf --bind "change:reload:fd --follow {q} ''$search_dir 2>/dev/null || true" --header="Type to search, Enter to cd" --preview '([[ -d {} ]] && ls -la {}) || ([[ -f {} ]] && head -20 {})' --height 40% --ansi)
target=$(echo "" | fzf --bind "change:reload:fd --follow -E Documents/app-state {q} ''$search_dir 2>/dev/null || true" --header="Type to search, Enter to cd" --preview '([[ -d {} ]] && ls -la {}) || ([[ -f {} ]] && head -20 {})' --height 40% --ansi)
if [[ -n "$target" ]]; then
[[ -d "$target" ]] && cd "$target" || cd "$(dirname "$target")"
fi
}
# Function to print path of file/directory selected with fzf
function pwdf() {
local search_dir="''${1:-~}"
local target
target=$(echo "" | fzf --bind "change:reload:fd --follow {q} ''$search_dir 2>/dev/null || true" --header="Type to search, Enter to print path" --preview '([[ -d {} ]] && ls -la {}) || ([[ -f {} ]] && head -20 {})' --height 40% --ansi)
target=$(echo "" | fzf --bind "change:reload:fd --follow -E Documents/app-state {q} ''$search_dir 2>/dev/null || true" --header="Type to search, Enter to print path" --preview '([[ -d {} ]] && ls -la {}) || ([[ -f {} ]] && head -20 {})' --height 40% --ansi)
if [[ -n "$target" ]]; then
echo "$target"
fi