kien / ctrlp.vim

Fuzzy file, buffer, mru, tag, etc finder.
kien.github.com/ctrlp.vim
7.26k stars 676 forks source link

Support slashes in filename-only search #717

Closed koterpillar closed 3 years ago

koterpillar commented 7 years ago

Sometimes I want to search for a file foo that I know is in a directory bar. Searching just for foo produces too many results matching on full paths, and limiting it with <c-d> still lists many file names matching foo. Searching bar/foo, again, matches foo in directory or file names.

I'm proposing to change <c-d> behavior to the following: the input string is split on directory separators (e.g. /), and each segment except the last must match within a directory name on the path. Examples (with <c-d> mode on):

The current functionality of <c-d> is not disrupted, as a search for foo still only matches files with foo in the name.