How to order by shortest match? #4012
Unanswered
palsivertsen
asked this question in
Q&A
Replies: 1 comment 3 replies
-
Have you tried setting export FZF_ALT_C_OPTS="--no-sort --tiebreak=length,begin,index" The maintainer is currently up in works and I am not too confident in my answer, he might weigh in when he comes back. Footnotes |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Is there any way to configure the ordering of results?
I use the ALT-C shortcut in bash to quickly navigate my folders. However, for certain paths (seems to be related to
-
), I get weird suggestions to my queries.Example
I have the following directory structure:
$ tree . ├── another-project │ └── with │ └── a │ └── sub │ └── directory │ └── called │ └── myproject └── my-project 9 directories, 0 files
... and I want to navigate to
my-project
, but I can't remember the exact name so I typemyject
and expect themy-project
directory to rank highest, since it's the shortest match. However fzf ranks the folder I want last. This is especially annoying when I have lots of results and the directory I want is often not even on screen.Even if I try to be more specific I do not get the correct result:
If it was sorted the other way around I could be more specific in my query to narrow the results.
Beta Was this translation helpful? Give feedback.
All reactions