babarot / enhancd

:rocket: A next-generation cd command with your interactive filter
2.58k stars 109 forks source link

Choose sorting methods #226

Open liangkarl opened 4 months ago

liangkarl commented 4 months ago

Describe the feature you'd like Add a option for choosing different sorting method for result.

I'm working on a multiple large projects environments and each project has similar tools or pathes. When I use cd foo in a directory that doesn't have foo, the result would be sorted by the frequency and time. However, for example, if there were two different version tools like project_a/has/foo and project_b/has/foo, and I was working in project_a/, it would be more reasonable in most of time that the cd foo result shows the subdirectories with matched names in a higher rank, which means in this case project_a/has/foo could have higher rank than project_b/has/foo.

Describe alternatives you've considered I have know idea how to sort the result without modify enhancd source codes

If we could have at least three categories for directories such as exact matched names, frequency, and the directory names under the same path that have been visited. it would significantly reduce the time for filtering and selecting options.

Additional context I suggest the ranking could be like this:

  1. exact names in subdir that have been visited and was just visited with higher freq
  2. exact names in subdir that have been visited with higher freq
  3. exact names was just visited with higher freq
  4. exact names with higher freq
  5. fuzzy matched names with higher freq image

If it could be implemented, it's a really perfect feature for enhancd.