diff --git a/Examples-(completion).md b/Examples-(completion).md index ff7f434..aaabcbc 100644 --- a/Examples-(completion).md +++ b/Examples-(completion).md @@ -76,39 +76,3 @@ complete -o bashdefault -o default -F _fzf_complete_ssh_notrigger ssh complete -o bashdefault -o default -F _fzf_complete_ssh_notrigger mosh complete -o bashdefault -o default -F _fzf_complete_ssh_notrigger ss ``` - -### Path depth and hidden sorted _fzf_compgen_path/dir (feat. `fd` and `rg`) - -Based on the example in the [README](https://github.com/junegunn/fzf#settings) for `fd` integration, this sorts from least to greatest path depth and then sorts hidden files after regular ones. This puts the most likely files you're going to access further up in the list and gets them into `fzf` faster. - -```bash -_fzf_compgen_path() { - local output - local -i depth=1 - while - output=$(fd -H -L -E ".git" --exact-depth "$depth" . "$1") - - rg -v "^\.|/\." <<<"$output" - rg "^\.|/\." <<<"$output" - - depth+=1 - - [ "$output" ] - do true; done -} - -_fzf_compgen_dir() { - local output - local -i depth=1 - while - output=$(fd -H -L -E ".git" --exact-depth "$depth" -t d . "$1") - - rg -v "^\.|/\." <<<"$output" - rg "^\.|/\." <<<"$output" - - depth+=1 - - [ "$output" ] - do true; done -} -``` \ No newline at end of file