m/fzf
1
0
mirror of https://github.com/junegunn/fzf.git synced 2025-11-17 07:43:39 -05:00

A replacement scriptlet for the one I wrote previously featured here

Patrick McFarland
2023-08-21 15:15:58 -04:00
parent 27a9c4eac9
commit 7eaceb60f3

@@ -75,4 +75,28 @@ _fzf_complete_ssh_notrigger() {
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
```
```
### [BASH] Use `bfs` instead of `fd` for more ergonomic results
Uses `bfs` to put shallow-depth paths closer to the top of results, while also leveraging `bfs`' superior performance over `fd`.
Based on: https://github.com/tavianator/bfs/discussions/119
See also: [`bfs` vs `fd` vs `find` benchmark](https://tavianator.com/2023/bfs_3.0.html#so-how-fast-is-it)
```bash
FZF_DEFAULT_OPTS="$FZF_DEFAULT_OPTS --ansi"
FZF_CTRL_T_COMMAND="bfs -color -mindepth 1 -exclude \( -name .git \) -printf '%P\n' 2>/dev/null"
FZF_ALT_C_COMMAND="bfs -color -mindepth 1 -exclude \( -name .git \) -type d -printf '%P\n' 2>/dev/null"
_fzf_compgen_path() {
bfs -H "$1" -color -exclude \( -name .git \) 2>/dev/null
}
_fzf_compgen_dir() {
bfs -H "$1" -color -exclude \( -name .git \) -type d 2>/dev/null
}
```