jethrokuan / z

Pure-fish z directory jumping
MIT License
1.26k stars 44 forks source link

Tab completion should be in order of relevance #97

Closed Sbozzolo closed 3 years ago

Sbozzolo commented 3 years ago

I haven't investigated too much, so maybe the answer is obvious. In that case, feel free to immediately close the issue. Consider this example:

$ z - l gray
423.664    /home/sbozzolo/documents/projects/2021/gray
143.898    /home/sbozzolo/documents/data/gray/test_fisheye
16         /home/sbozzolo/documents/projects/2021/gray/tests
8          /home/sbozzolo/documents/projects/2021/gray/tools
7.794      /home/sbozzolo/documents/data/gray
[TRUNCATED]

With z gray I can move me to the first directory, as expected. Sometimes, I want to cd into the second one, so I hit z gray [TAB], resulting in

/home/sbozzolo/documents/data/gray                                          /home/sbozzolo/documents/projects/2021/gray-python                  
/home/sbozzolo/documents/data/gray/test_fisheye                             /home/sbozzolo/documents/projects/2021/gray-python/gray             
[TRUNCATED]

As you see, the order does not reflect the score, so I have to navigate to the relevant one, which can be multiple key presses away. It would be nice if the order of the suggestions followed the score. This would be in the spirit of z and would minimize the number of keystrokes.

krobelus commented 3 years ago

that sounds reasonable

Sbozzolo commented 3 years ago

Thank you very much!

I updated and it doesn't look like that the problem is solved: 2021-03-12:13:07:47

The order is different but it doesn't reflect z -l

krobelus commented 3 years ago

my bad, should be fixed as of 97ca1fd1b281f5f240e7adb90d0a28f9eb4567db