fish-shell / fish-shell/fish-shell
Consider adding a native fuzzy path picker
- Dominant language
- Rust
- Stars
- 34.2k
- Forks
- 2.4k
- Avg merge
- 2d 8h
- Merged PRs (30d)
- 13
Description
This is a big feature request and is probably out of scope, though it is also a sort of thing which I think fits fish general philosophy of making reasonable things work well out of the box. Basically, I want fish to have `fzf --fish` built-in.
Here's a specific use-case. I am in directory `foo`, and I want to run a command passing a file from directory bar. My shell looks like this
```
matklad@TigerMac ~/p/matklad.github.io (master)
λ deno task spell ~/p/blog/
```
what I want to do is to "auto-complete" the path to a file somewhere _deep_ in the blog directory. The UX I want here is a fuzz file picker.
The good news here is that, due to how awesome UNIX philosophy is, I can achieve this by stringing together other tools. I just need to know that `fzf` solves the problem of fuzzy-finding, and `fd` solves the problem of listing files, so I can consult various manpages, chuck
```
set -gx FZF_CTRL_T_COMMAND 'fd --type f'
fzf --fish | source
```
to my fish.config, and then press `^T` for all the fzf glory.
The bad news is that, unless you do full-time UNIX, the philosophy isn't very user-friendly. It took me years to realize that "fuzzy picking a path argument" is a thing I might want to want, about an hour to figure out how to actually achieve that, and today I realized that my solution doesn't actually work, because, in the above example, my fzf thingy doesn't actually pick `~/p/blog` as a root directory to search into, and instead looks inside `~/p/matklad.github.io`. Given that I use this feature once in a blue moon, it just doesn't make sense for me to figure out how to improve that.
Contrast this with beloved fish auto-suggestion feature, which just works even before you know you need it.
I think it'd be great if, instead of tab, a fish user could press something like ctrl-tab, and get a command-aware path picker.
Given that fish is implanted in Rust these days, all individual components should be available off the shelf?
Contributor guide
Assessment
This issue has not been assessed yet.