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 --> 0otherdir1/otherfile2 --> 1../otherfile3 --> 1../otherdir2/otherfile4 --> 2The 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.
Thanks @wookayin!
Most helpful comment
See https://github.com/junegunn/fzf.vim/issues/788, #1380, and https://github.com/jonhoo/proximity-sort