RE: File name completion for files residing in multiple directories

2007-02-14 Thread Hari Krishna Dara

On Mon, 12 Feb 2007 at 8:07pm, Max Dyckhoff wrote:

> This is a bug which I have actually informed Hari of a while ago, but
> perhaps my bug email got lost :)

The email is not lost, just extremely busy with work and personal life
:)

Also, lately I have been using eclipse more and more at my new job,
and haven't been spending much time in vim. The java specific features
of the IDE are extremely productive, but I wish I can plug right gvim into
the editor and still be able to use all the java specific features such
as quick fixes, completions etc.

> The default mapping for LookupFile is F5. What this error message
> means is that you already have a mapping for F5 in your .vimrc file,
> and you haven't specified a mapping for LookupFile. In this
> situations, LookupFile will try to map F5 to LookupFile, which
> fails with the error message that you get.
>
> This is annoying, and this is my work around for it until Hari fixes
> it. All you need is the final line, some random unused mapping to
> LookupFile, and that will stop the error from firing.
>
> :map   :LookupFile  " enter LookupFile
explicitly
> :map   :LUWalk" enter LUWalk
explicitly
> :map   :LUPath" enter LUPath
explicitly
> :imap   LookupFile   " exit LookupFile
> :map   LookupFile   " something random to
remove the error!

The plugin just follows the suggested  mapping approach (see
|write-plugin|), and this is not usually a nuisance, as you would expect
the user to always create a mapping, even if the default is undesirable.
However, in this specific case, I realize you didn't want to map 
directly to LookupFile because you don't like the default behavior
of remapping  to whatever is the latest operation. In fact, this has
been bugging me also, but haven't taken the time to think of the right
alternative. It might be best to create a different plug mapping for
this purpose and have a flag to disable it altogether. Suggestions
welcome.

-- 
Thanks,
Hari
>
>
> > -Original Message-
> > From: Meino Christian Cramer [mailto:[EMAIL PROTECTED]
> > Sent: Monday, February 12, 2007 7:30 PM
> > To: Max Dyckhoff
> > Cc: [EMAIL PROTECTED]; vim@vim.org
> > Subject: Re: File name completion for files residing in multiple
> > directories
> >
> > From: Max Dyckhoff <[EMAIL PROTECTED]>
> > Subject: RE: File name completion for files residing in multiple
> > directories
> > Date: Mon, 12 Feb 2007 11:58:35 -0800
> >
> > I installed lookupfile and got back this error message while starting
> > vim (console):
> >
> > Error detected while processing
> > /home/mccramer/.vim/plugin/lookupfile.vim:
> > line  105:
> > E227: mapping already exists for [EMAIL PROTECTED]
> > Press ENTER or type command to continue
> >
> > ???
> >
> >
> >
> > > You want Hari's LookupFile plugin, which you can find on vim.org.
> > It's awesome, and has speeded up my development massively. It does
> > exactly what you want, in almost exactly the way you suggest.
> > >
> > > Max
> > >
> > > > -Original Message-
> > > > From: Erik Bergman [mailto:[EMAIL PROTECTED]
> > > > Sent: Monday, February 12, 2007 10:53 AM
> > > > To: vim@vim.org
> > > > Subject: File name completion for files residing in multiple
> > > > directories
> > > >
> > > > 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.
> > > >
> > > > What I think would be an nice solution is if there was some way to
> > make
> > > > vim
> > > > perform file name completion using 'file' tags from the tag file.
> > That
> > > > way
> > > > you could still use tags for other things, and most often the files
> > you
> > > > generate tags for are exactly the files you want to be able to open
> > and
> > > > switch between quickly.
> > > >
> > > > Can anyone think of a better solution? Would it be possible to
> > > > integrate
> > > > this feature into vim in a nice way?
> > > >
> > > > /Erik Berman
>
>


 

Want to start your own business?
Learn how on Yahoo! Small Business.
http://smallbusiness.yahoo.com/r-index


Re: File name completion for files residing in multiple directories

2007-02-13 Thread Erik Bergman

Looks good. Thanks!
I will go going away for a while and won't have access to a computer,
but I will try it out once I get back.

(Sorry for not replying directly to the mailing list the first time.
gmail's defaults are kinda funny at times)

/Erik Bergman

On 2/12/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:

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/



RE: File name completion for files residing in multiple directories

2007-02-12 Thread Max Dyckhoff
This is a bug which I have actually informed Hari of a while ago, but perhaps 
my bug email got lost :)

The default mapping for LookupFile is F5. What this error message means is that 
you already have a mapping for F5 in your .vimrc file, and you haven't 
specified a mapping for LookupFile. In this situations, LookupFile will 
try to map F5 to LookupFile, which fails with the error message that you 
get.

This is annoying, and this is my work around for it until Hari fixes it. All 
you need is the final line, some random unused mapping to LookupFile, and 
that will stop the error from firing.

:map   :LookupFile  " enter LookupFile 
explicitly
:map   :LUWalk" enter LUWalk 
explicitly
:map   :LUPath" enter LUPath 
explicitly
:imap   LookupFile   " exit LookupFile
:map   LookupFile   " something random to 
remove the error!

Max


> -Original Message-
> From: Meino Christian Cramer [mailto:[EMAIL PROTECTED]
> Sent: Monday, February 12, 2007 7:30 PM
> To: Max Dyckhoff
> Cc: [EMAIL PROTECTED]; vim@vim.org
> Subject: Re: File name completion for files residing in multiple
> directories
>
> From: Max Dyckhoff <[EMAIL PROTECTED]>
> Subject: RE: File name completion for files residing in multiple
> directories
> Date: Mon, 12 Feb 2007 11:58:35 -0800
>
> I installed lookupfile and got back this error message while starting
> vim (console):
>
> Error detected while processing
> /home/mccramer/.vim/plugin/lookupfile.vim:
> line  105:
> E227: mapping already exists for [EMAIL PROTECTED]
> Press ENTER or type command to continue
>
> ???
>
>
>
> > You want Hari's LookupFile plugin, which you can find on vim.org.
> It's awesome, and has speeded up my development massively. It does
> exactly what you want, in almost exactly the way you suggest.
> >
> > Max
> >
> > > -----Original Message-----
> > > From: Erik Bergman [mailto:[EMAIL PROTECTED]
> > > Sent: Monday, February 12, 2007 10:53 AM
> > > To: vim@vim.org
> > > Subject: File name completion for files residing in multiple
> > > directories
> > >
> > > 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.
> > >
> > > What I think would be an nice solution is if there was some way to
> make
> > > vim
> > > perform file name completion using 'file' tags from the tag file.
> That
> > > way
> > > you could still use tags for other things, and most often the files
> you
> > > generate tags for are exactly the files you want to be able to open
> and
> > > switch between quickly.
> > >
> > > Can anyone think of a better solution? Would it be possible to
> > > integrate
> > > this feature into vim in a nice way?
> > >
> > > /Erik Berman


Re: File name completion for files residing in multiple directories

2007-02-12 Thread Meino Christian Cramer
From: Max Dyckhoff <[EMAIL PROTECTED]>
Subject: RE: File name completion for files residing in multiple directories
Date: Mon, 12 Feb 2007 11:58:35 -0800

I installed lookupfile and got back this error message while starting
vim (console):

Error detected while processing /home/mccramer/.vim/plugin/lookupfile.vim:
line  105:
E227: mapping already exists for [EMAIL PROTECTED]
Press ENTER or type command to continue

???



> You want Hari's LookupFile plugin, which you can find on vim.org. It's 
> awesome, and has speeded up my development massively. It does exactly what 
> you want, in almost exactly the way you suggest.
> 
> Max
> 
> > -Original Message-
> > From: Erik Bergman [mailto:[EMAIL PROTECTED]
> > Sent: Monday, February 12, 2007 10:53 AM
> > To: vim@vim.org
> > Subject: File name completion for files residing in multiple
> > directories
> >
> > 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.
> >
> > What I think would be an nice solution is if there was some way to make
> > vim
> > perform file name completion using 'file' tags from the tag file. That
> > way
> > you could still use tags for other things, and most often the files you
> > generate tags for are exactly the files you want to be able to open and
> > switch between quickly.
> >
> > Can anyone think of a better solution? Would it be possible to
> > integrate
> > this feature into vim in a nice way?
> >
> > /Erik Berman


RE: File name completion for files residing in multiple directories

2007-02-12 Thread Max Dyckhoff
You want Hari's LookupFile plugin, which you can find on vim.org. It's awesome, 
and has speeded up my development massively. It does exactly what you want, in 
almost exactly the way you suggest.

Max

> -Original Message-
> From: Erik Bergman [mailto:[EMAIL PROTECTED]
> Sent: Monday, February 12, 2007 10:53 AM
> To: vim@vim.org
> Subject: File name completion for files residing in multiple
> directories
>
> 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.
>
> What I think would be an nice solution is if there was some way to make
> vim
> perform file name completion using 'file' tags from the tag file. That
> way
> you could still use tags for other things, and most often the files you
> generate tags for are exactly the files you want to be able to open and
> switch between quickly.
>
> Can anyone think of a better solution? Would it be possible to
> integrate
> this feature into vim in a nice way?
>
> /Erik Berman


Re: File name completion for files residing in multiple directories

2007-02-12 Thread Hari Krishna Dara

On Mon, 12 Feb 2007 at 7:53pm, Erik Bergman 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.
>
> What I think would be an nice solution is if there was some way to make vim
> perform file name completion using 'file' tags from the tag file. That way
> you could still use tags for other things, and most often the files you
> generate tags for are exactly the files you want to be able to open and
> switch between quickly.
>
> Can anyone think of a better solution? Would it be possible to integrate
> this feature into vim in a nice way?
>
> /Erik Berman

Have you looked at my LookupFile plugin from vim.org? I think it has
exactly what you need.

-- 
Hari


 

It's here! Your new message!  
Get new email alerts with the free Yahoo! Toolbar.
http://tools.search.yahoo.com/toolbar/features/mail/


Re: File name completion for files residing in multiple directories

2007-02-12 Thread hermitte
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/


File name completion for files residing in multiple directories

2007-02-12 Thread Erik Bergman

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.

What I think would be an nice solution is if there was some way to make vim
perform file name completion using 'file' tags from the tag file. That way
you could still use tags for other things, and most often the files you
generate tags for are exactly the files you want to be able to open and
switch between quickly.

Can anyone think of a better solution? Would it be possible to integrate
this feature into vim in a nice way?

/Erik Berman