ctrlpvim / ctrlp.vim

Active fork of kien/ctrlp.vim—Fuzzy file, buffer, mru, tag, etc finder.
ctrlpvim.github.com/ctrlp.vim
Other
5.57k stars 259 forks source link

Search by filename, but still allow to specify directory #544

Open Svalorzen opened 4 years ago

Svalorzen commented 4 years ago

I'd like my searches to somehow give priority to things that match the filename rather than a directory, since a filename is specific to that file, while matching a directory, even perfectly, still leaves as options all files contained in a directory. In other words, since I am looking for a specific file, I'm more likely to search for a filename rather than a random directory, so matches inside of a filename should be ranked higher.

Since changing the algorithm that sorts the matches is not simple, I have started to use the ctrlp_by_filename option. This is nice since I get to directly search for a filename, but at the same time with this option the path is completely discarded.

Would it be possible to search for a filename, but leave the option to refine the search of the directory? Either by keeping search as-is, or adding some delimiter character to separately filter filenames and directories; something like

filename_search,directory_search

Where the comma has been defined as the character to use to split the search.

brandon1024 commented 6 months ago

I believe this is a duplicate of https://github.com/ctrlpvim/ctrlp.vim/issues/318