Open fjchen7 opened 3 years ago
man fzf
I rewrite _fzf_compgen_dir as following
_fzf_compgen_dir
_fzf_compgen_dir() { fd --color=always --type d --max-depth 2 --hidden --follow --exclude ".git" . "$1" }
However cd **$<tab> always gives directory candidates with $ as query, while what I want is searching in environment variables list.
cd **$<tab>
$
I try to filter $ out from _fzf_compgen_dir's input and modify it like this
_fzf_compgen_dir() { if [[ "$1" == "\$" ]]; then env | cut -d"=" -f1 else fd --color=always --type d --max-depth 2 --hidden --follow --exclude ".git" . "$1" fi }
But it still doesn't work.
Very appreciate it if anyone can provider some insights.
I'm trying to do something similar. Did you found a solution?
man fzf
)Info
Problem / Steps to reproduce
I rewrite
_fzf_compgen_dir
as followingHowever
cd **$<tab>
always gives directory candidates with$
as query, while what I want is searching in environment variables list.I try to filter
$
out from_fzf_compgen_dir
's input and modify it like thisBut it still doesn't work.
Very appreciate it if anyone can provider some insights.