skywind3000 / z.lua

:zap: A new cd command that helps you navigate faster by learning your habits.
MIT License
2.94k stars 137 forks source link

Allow `z -b` to do fuzzy matching #170

Closed ilyagr closed 1 year ago

ilyagr commented 1 year ago

If z -b foo bar finds no exact match in the path to the current directory, it tries a "fuzzy" substitution with a frecent directory. For example, if we are in ~/github/jekyll/test and run z -b jek gh, it will try to substitute the entire jekyll path component with gh. The result will be equivalent to running z ~/github gh test.

The middle commit changes indentation, but is a no-op.

I've been using this for a bit. It seems nice.

skywind3000 commented 1 year ago

Thanks, this is a big patch, I will review later.

ilyagr commented 1 year ago

Sure, take your time! Anyone who wants to can try this out using this branch.

I added one more feature to z -b in my fork, but I have some doubts if that one actually makes sense or is worth the complexity.

skywind3000 commented 1 year ago

thanks

ilyagr commented 1 year ago

Thank you! :)