Fzf: Feature request: allow sorting by file "distance"

Created on 28 Jun 2019  路  2Comments  路  Source: junegunn/fzf

  • Category

    • [x] fzf binary

  • OS

    • [x] Any

  • Shell

    • [x] Any

It would be great to have a feature that sorts files by "distance" to the current directory. By distance I mean "how many directory changes are needed to be in that file's directory".

Examples of distance values:

  • otherfile1 --> 0
  • otherdir1/otherfile2 --> 1
  • ../otherfile3 --> 1
  • ../otherdir2/otherfile4 --> 2

The implementation could be quite simple: take the number of slashes in the path as the distance.

This would be quite useful when called from an editor when one wants to open a file that is close to the currently edited file.

question tip wontfix

Most helpful comment

All 2 comments

Thanks @wookayin!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

aleclarson picture aleclarson  路  3Comments

alistaircolling picture alistaircolling  路  3Comments

leonklingele picture leonklingele  路  3Comments

erusev picture erusev  路  3Comments

asilvadesigns picture asilvadesigns  路  3Comments