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):
bar/somewhere/foo.txt matches bar/foo.
baz/unrelated/foo.txt does not match bar/foo, even though it would without <c-d>.
bar/foo/more.txt does not match bar/foo.
The current functionality of <c-d> is not disrupted, as a search for foo still only matches files with foo in the name.
Sometimes I want to search for a file
foo
that I know is in a directorybar
. Searching just forfoo
produces too many results matching on full paths, and limiting it with<c-d>
still lists many file names matchingfoo
. Searchingbar/foo
, again, matchesfoo
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):bar/somewhere/foo.txt
matchesbar/foo
.baz/unrelated/foo.txt
does not matchbar/foo
, even though it would without<c-d>
.bar/foo/more.txt
does not matchbar/foo
.The current functionality of
<c-d>
is not disrupted, as a search forfoo
still only matches files withfoo
in the name.