Hello,
Erik Bergman <[EMAIL PROTECTED]> wrote:
> I've been searching for a nice way to quickly open files that may reside in
> any of number of directories, similar to the "quick open" feature you find
> in some other editors. One solution is to mess around with the ** and *
> wildcards, but this gets terribly slow for large projects. Another
> "solution" is to set the 'path' variable, but vim does not perform
> completion on files opened that way. A third solution is to generate file
> name tags and use :tag to jump to files, but in that case you will perform
> completion on just not file names, but other tags as well. Finally, you can
> open all files you need to switch between and use :b, but for obvious
> reasons this isn't very practical.
> [...]
> Can anyone think of a better solution? Would it be possible to integrate
> this feature into vim in a nice way?
It may not be exactly what you are looking for, but still this is a good
approximation [1] I think.
I've been maintening a plugin called searchInRuntime. It provides various
commands to open (or do anything else on) files that can be found in lists of
directories. I often use
:Hs foo.cpp
-> horizontally split-open foo.cpp which is searched into &path ;
If several files matches, a choice is proposed ;
If the file is already opened, we jump to the window were the file
is being edited
:SearchInVar! $INCLUDE sp foo/bar*h
-> searches all (-> bang) occurrences of foo/bar*.h into $INCLUDE
and split-open the files found. We could use &path and its '**'
with no problem
And there are many more similar commands. All support a "smart"-completion (i.e.
the completion on the first parameter of SearchInVar is made considering the
parameter must be a variable, the second a command, and the others pathnames).
The support of completion requires vim7.
There is a documentation bundled in the archive which could be found on SF
(script #229 IIRC), or on my web site at
http://hermitte.free.fr/vim/ressources/
The version on my web site may be more recent.
[1] I'm of course 100% subjective. :)
HTH,
--
Luc Hermitte
http://hermitte.free.fr/vim/