Question
How do you have vim find or search for a file in the path when opening a split?
In vim, I can find a file and open it in a new tab using :tabfind
, and I can open a file I know the location of in a new split using :split
or :vsplit
. However, I would like vim to find files for me in my path when running the :split
or :vsplit
commands. For example, say in my current directory, I have these files (all of which are in my path):
./ReallyLongFileName1.txt
./fooDir/ReallyLongFileName2.txt
./barDir/bazDir/ReallyLongFileName3.txt
I would like to type the following command in vim:
:vsplit R<Tab>
And have vim search in my path for all files that match that expression, and fill the rest of the line with
:vsplit ReallyLongFileName
This works perfectly with :find
or :tabfind
, but it doesn't work when splitting. Is there a command that does this that I just don't know about, or is there some way to add this functionality to the :split
and :vsplit
commands?