rupa / z

z - jump around
Do What The F*ck You Want To Public License
16.38k stars 1.17k forks source link

Go directly to exact match instead of subdirectory #296

Open madprops opened 3 years ago

madprops commented 3 years ago

I find the following to not work as I would expect:

z pics1 /home/user/Downloads/pics/pics1

z Downloads /home/user/Downloads/pics/pics1

In the second command I intended to go to the Downloads directory. I personally think it should have gone to Downloads since it's specifically using that name directly, instead of going to a subdirectory.

ghost commented 3 years ago

Yes, that would be helpful

msudgh commented 3 years ago

🔥 Very useful improvement on directory matching logic. I have the same problem and it's better a flag indicates if users need to match the exact directory if matched in the ranked list.

delanym commented 3 years ago

I guess I have the same issue:

/git/tepe $ cd ../tep /git/tep $ cd ../tepe /git/tepe $ z tep /git/tepe $

Isn't this the whole point of the program?

Gevrai commented 3 years ago

The Readme even says the following, which I would assume means that it should match the shortest /home/user/Downloads/ in your example.

   Common:
       When multiple directories match all queries, and they all have a common
       prefix, z will cd to the shortest matching directory, without regard to
       priority.  This has been in effect, if  undocumented,  for  quite  some
       time, but should probably be configurable or reconsidered.
madprops commented 3 years ago

I'm working on a separate z implementation that fixes this issue https://github.com/madprops/ezkl