On 5/9/06, Hari Krishna Dara <[EMAIL PROTECTED]> wrote:

On Tue, 9 May 2006 at 9:32pm, Yakov Lerner wrote:

> Benjamin Reitzammer <[EMAIL PROTECTED]> wrote:
> > I'm forwarding this to the list so that everyone can help :)
> >
> > ---------- Forwarded message ----------
> > Date: Tue, 9 May 2006 19:36:45 +0200
> > From: Benjamin Reitzammer <[EMAIL PROTECTED]>
> > To: Gerald Lai <[EMAIL PROTECTED]>
> > Subject: Re: fast file opening / find file as you type
> >
> > Hi,
> >
> > On 5/9/06, Gerald Lai <[EMAIL PROTECTED]> wrote:
> > > On Tue, 9 May 2006, Benjamin Reitzammer wrote:
> > >
> > > [snip]
> > > >> Regarding :find. It does not do &path-full completion, and
> > > >> no 'incremental completion menu'. To write such plugin, you'd
> > > >> need to process every typed character.
> > > >
> > > > Yes I tried, :find and that it's not doing completion of my filename,
> > > > is something that makes it a lot less useful. Sure it broadened my vim
> > > > skills ;) but it's still not as good as the described solution the
> > > > jedit plugin offers.
> > > [snip]
> > >
> > > This has been suggested in the list before (by Hari, I think). Put these
> > > lines in your vimrc:
> > >
> > > ==
> > >    command! -nargs=? -complete=custom,PathFileComplete -bang -bar Find
> > > find<bang> <args>
> > >    function! PathFileComplete(ArgLead, CmdLine, CursorPos)
> > >      return substitute(globpath(&path, a:ArgLead."*"), "[^\n]\\+/", "",
"g")
> > >    endfunction
> > >
> > >    set wildmenu wildmode=longest:full
> > > ==
> > >
> > > Then instead of doing
> > >
> > >    :find <partial filename>
> > >
> > > do
> > >
> > >    :Find <partial filename>
> > >    (notice the capital "F")
> > >
> > > Completion will work now. :Find is :find with completion.
> >
> > Wow, thanks ... this is cool.
> >
> > > Take note of what Jürgen & Tim had to say. :Find will look in the
> > > directories specified in the option 'path', as Jürgen mentioned.
> >
> > Don't call me picky ... but there's the problem (at least if
> > understand the help for the path option correctly). If a path ends
> > with ** it searches only for directory names, while * searches only
> > the direct subdirectories for the given paths.
>
>
> In vim7 dir/** shows matches both in directory dir itself
> *and* in subdirectories. This is better than in 6.4 where
> dir/** didn't show matches in dir itself (only in
> subdirectories of dir)
>
> Yakov

Thanks for the tip. However, this is very slow on huge directory
structures. On my project directory, this didn't finish in a minute,

That's why I mentioned that cached (supposedly, in
the file?) dir trees is useful for such plugin, which
does not yet exist for vim. The 'incremental
completion menu' is also very nice feature. THis is what
Benjamin described, when you type characters
of the filename, and completion menu gets updated
automatically w/o your need to press Tab over and over again. I think
this would be very nice. It's not
easy to script such thing for vim, though.
But possible. But difficult. I'm not going to write it.

Yakov

Reply via email to