fzf
fzf copied to clipboard
Limit search by delimiter (e.g. slashes between directories)
- Category
- [x] fzf binary
- [ ] fzf-tmux script
- [ ] Key bindings
- [ ] Completion
- [ ] Vim
- [ ] Neovim
- [ ] Etc.
- OS
- [x] Linux
- [x] Mac OS X
- [ ] Windows
- [ ] Windows Subsystem for Linux
- [ ] Etc.
- Shell
- [x] bash
- [x] zsh
- [ ] fish
My feature request is probably best explained by an example. Given the following lines:
app/models/foo/bar/baz.rb
app/models/foo/bar-baz.rb
app/models/foo-bar-baz.rb
app/monsters/dungeon/foo/bar/baz.rb
(Using the default fuzzy searching mode), if I type app/mod/fo/ba/baz
, I want fzf to filter down to app/models/foo/bar/baz.rb
, and not include any of the others.
In other words, if I know in my head the dir structure of my project, and I want to get at a file that is under a specific subtree in the repo, I want to be able to use slashes to trim fzf's result set.
As fzf is now, when I type app/mod
, it matches both app/models
and app/monsters/dungeon
because the letters mo
are in monsters
and d
is in dungeon
.
some combination of -e (exact) -d (specify / as delimiter) and --with-nth to specify nesting level of the delimiter maybe what you are after?
i.e.
cat $filelist | fzf -e -d '/' --with-nth=5
@shedali Thanks for your suggestion. I couldn't get it to do what I wanted, though.
I can get close, but not quite, with fzf -n .. -d /
. It still cuts across multiple directories.
Closing as wontfix, because the matching algorithm of fzf is not specifically designed for file paths. Including app/monsters/dungeon
in the result doesn't seem like a problem because it's ranked lower than the rest. And you can use exact matching by prefixing the term with '
. e.g. 'app/mod f--