autocomplete

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

autocomplete

Sean Hubbell
Hello,

  I use vim daily to edit and modify source code. I realize that vim is
"just" an editor, but I was wondering if someone has possibly created a
plugin that provides a balloon prototype tool tip. For example, if I
have the following defined in a header file (<filename>.h:

void ThisRoutine (long first, long second, double third);

and I was adding a function in the source file (<filename>.cpp):

I would start typing:

ThisRou

and get a balloon that told me what the parameter list is.


Thanks,

Sean
Reply | Threaded
Open this post in threaded view
|

Re: autocomplete

Aaron Griffin
On 8/31/05, Sean Hubbell <[hidden email]> wrote:

> Hello,
>
>   I use vim daily to edit and modify source code. I realize that vim is
> "just" an editor, but I was wondering if someone has possibly created a
> plugin that provides a balloon prototype tool tip. For example, if I
> have the following defined in a header file (<filename>.h:
>
> void ThisRoutine (long first, long second, double third);
>
> and I was adding a function in the source file (<filename>.cpp):
>
> I would start typing:
>
> ThisRou
>
> and get a balloon that told me what the parameter list is.
>

Well, I don't know about Visual Studio style frilly balloons, but you
can get possible completions listed in a previewwindow with the
icomplete or cguess plugins.  I use icomplete, but it has a few minor
kinks.
Reply | Threaded
Open this post in threaded view
|

Re: autocomplete

Charles E Campbell Jr
In reply to this post by Sean Hubbell
Sean Hubbell wrote:

>  I use vim daily to edit and modify source code. I realize that vim is
> "just" an editor, but I was wondering if someone has possibly created
> a plugin that provides a balloon prototype tool tip. For example, if I
> have the following defined in a header file (<filename>.h:
>
> void ThisRoutine (long first, long second, double third);
>
> and I was adding a function in the source file (<filename>.cpp):
>
> I would start typing:
>
> ThisRou
>
> and get a balloon that told me what the parameter list is.


My flist program,  available at
http://mysite.verizon.net/astronaut/src/index.html , analyzes C source files
(and C++ too, although it doesn't handle templates) and generates
"hints" files.  I have a map...

  nmap <silent> <F4>  :so $HDR/hints<bar>echomsg "hints loaded"<CR>

which I use to source (load) the hints file.  Then, when I type  
myfunction(  a copy of the prototype shows
up as an echoed message for the "myfunction" function.  To generate
hints with flist:

  flist -h *.c ...

or use recursive descent down a directory tree:

  flist -rh /path/to/some/directory

You'll need to compile flist yourself, though.

Regards,
Chip Campbell

Reply | Threaded
Open this post in threaded view
|

Re: autocomplete

Aaron Griffin
On 8/31/05, Charles E. Campbell, Jr. <[hidden email]> wrote:

> Sean Hubbell wrote:
>
> >  I use vim daily to edit and modify source code. I realize that vim is
> > "just" an editor, but I was wondering if someone has possibly created
> > a plugin that provides a balloon prototype tool tip. For example, if I
> > have the following defined in a header file (<filename>.h:
> >
> > void ThisRoutine (long first, long second, double third);
> >
> > and I was adding a function in the source file (<filename>.cpp):
> >
> > I would start typing:
> >
> > ThisRou
> >
> > and get a balloon that told me what the parameter list is.
>
>
> My flist program,  available at
> http://mysite.verizon.net/astronaut/src/index.html , analyzes C source files
> (and C++ too, although it doesn't handle templates) and generates
> "hints" files.  I have a map...
>
>   nmap <silent> <F4>  :so $HDR/hints<bar>echomsg "hints loaded"<CR>
>
> which I use to source (load) the hints file.  Then, when I type
> myfunction(  a copy of the prototype shows
> up as an echoed message for the "myfunction" function.  To generate
> hints with flist:
>
>   flist -h *.c ...
>
> or use recursive descent down a directory tree:
>
>   flist -rh /path/to/some/directory
>
> You'll need to compile flist yourself, though.
>
> Regards,
> Chip Campbell

Sounds kinda cool.  Similar to what icomplete does, except icomplete
will parse c++ and understand scope fairly well.  Another thing I like
about icomplete is that it parses through headers as well and
understands types.

    #include <string>
    std::string s;
    s.
when you type the "." a previewwindow displays listing all the member
functions of "std::string"
Reply | Threaded
Open this post in threaded view
|

Re: autocomplete

Fan Decheng
In reply to this post by Sean Hubbell
Sean Hubbell wrote:

> Hello,
>
>  I use vim daily to edit and modify source code. I realize that vim is
> "just" an editor, but I was wondering if someone has possibly created
> a plugin that provides a balloon prototype tool tip. For example, if I
> have the following defined in a header file (<filename>.h:
>
> void ThisRoutine (long first, long second, double third);
>
> and I was adding a function in the source file (<filename>.cpp):
>
> I would start typing:
>
> ThisRou
>
> and get a balloon that told me what the parameter list is.
>
>
> Thanks,
>
> Sean
>
>
I just saw something like this today. Check this out:
Vim Intellisense
http://insenvim.sourceforge.net/
http://insenvim.sourceforge.net/images/vis_html.jpg
Reply | Threaded
Open this post in threaded view
|

Re: autocomplete

marc chantreux-2
Fan Decheng a ?crit :
> I just saw something like this today. Check this out:
> Vim Intellisense
> http://insenvim.sourceforge.net/
> http://insenvim.sourceforge.net/images/vis_html.jpg

only for gvim under windows. i've just tested icomplete dans it's very good.

regards
mc
Reply | Threaded
Open this post in threaded view
|

Re: autocomplete

Kyku-2
In reply to this post by Charles E Campbell Jr
Charles E. Campbell, Jr. wrote:

> Sean Hubbell wrote:
>
>>  I use vim daily to edit and modify source code. I realize that vim
>> is "just" an editor, but I was wondering if someone has possibly
>> created a plugin that provides a balloon prototype tool tip. For
>> example, if I have the following defined in a header file (<filename>.h:
>>
>> void ThisRoutine (long first, long second, double third);
>>
>> and I was adding a function in the source file (<filename>.cpp):
>>
>> I would start typing:
>>
>> ThisRou
>>
>> and get a balloon that told me what the parameter list is.
>
>
>
> My flist program,  available at
> http://mysite.verizon.net/astronaut/src/index.html , analyzes C source
> files
> (and C++ too, although it doesn't handle templates) and generates
> "hints" files.  I have a map...
>
>  nmap <silent> <F4>  :so $HDR/hints<bar>echomsg "hints loaded"<CR>
>
> which I use to source (load) the hints file.  Then, when I type  
> myfunction(  a copy of the prototype shows
> up as an echoed message for the "myfunction" function.  To generate
> hints with flist:
>
>  flist -h *.c ...
>
> or use recursive descent down a directory tree:
>
>  flist -rh /path/to/some/directory
>
> You'll need to compile flist yourself, though.
>
> Regards,
> Chip Campbell
>
>
>
I gave your program a try and it seems quite promising, but after
generating and sourcing the hints file, I couldn't see any tips echoed.
I suppose they are immediatelly overwritten by '--INSERT--' status
message. Is any additional setup of Vim required to make it work?

-------------------------------
  System statystyk stron www
    http://www.webstat.pl


Reply | Threaded
Open this post in threaded view
|

RE: autocomplete

Keith W. Roberts
 

> -----Original Message-----
> From: KWrzalik [mailto:[hidden email]]
> Sent: Thursday, September 08, 2005 1:33 PM
> To: Charles E. Campbell, Jr.
> Cc: [hidden email]
> Subject: Re: autocomplete
>
> Charles E. Campbell, Jr. wrote:
>
> > Sean Hubbell wrote:
> >
> >>  I use vim daily to edit and modify source code. I realize
> that vim
> >> is "just" an editor, but I was wondering if someone has possibly
> >> created a plugin that provides a balloon prototype tool tip. For
> >> example, if I have the following defined in a header file
> (<filename>.h:
> >>
> >> void ThisRoutine (long first, long second, double third);
> >>
> >> and I was adding a function in the source file (<filename>.cpp):
> >>
> >> I would start typing:
> >>
> >> ThisRou
> >>
> >> and get a balloon that told me what the parameter list is.
> >
> >
> >
> > My flist program,  available at
> > http://mysite.verizon.net/astronaut/src/index.html ,
> analyzes C source
> > files
> > (and C++ too, although it doesn't handle templates) and generates
> > "hints" files.  I have a map...
> >
> >  nmap <silent> <F4>  :so $HDR/hints<bar>echomsg "hints loaded"<CR>
> >
> > which I use to source (load) the hints file.  Then, when I type  
> > myfunction(  a copy of the prototype shows
> > up as an echoed message for the "myfunction" function.  To generate
> > hints with flist:
> >
> >  flist -h *.c ...
> >
> > or use recursive descent down a directory tree:
> >
> >  flist -rh /path/to/some/directory
> >
> > You'll need to compile flist yourself, though.
> >
> > Regards,
> > Chip Campbell
> >
> >
> >
> I gave your program a try and it seems quite promising, but after
> generating and sourcing the hints file, I couldn't see any
> tips echoed.
> I suppose they are immediatelly overwritten by '--INSERT--' status
> message. Is any additional setup of Vim required to make it work?
>

You could try increasing &cmdheight or unsetting &showmode.

:h 'ch'
:h 'smd'

-Keith


Reply | Threaded
Open this post in threaded view
|

Re: autocomplete

Kyku-2
Keith W. Roberts wrote:

>
>
>  
>
>>-----Original Message-----
>>From: KWrzalik [mailto:[hidden email]]
>>Sent: Thursday, September 08, 2005 1:33 PM
>>To: Charles E. Campbell, Jr.
>>Cc: [hidden email]
>>Subject: Re: autocomplete
>>
>>Charles E. Campbell, Jr. wrote:
>>
>>    
>>
>>>Sean Hubbell wrote:
>>>
>>>      
>>>
>>>> I use vim daily to edit and modify source code. I realize
>>>>        
>>>>
>>that vim
>>    
>>
>>>>is "just" an editor, but I was wondering if someone has possibly
>>>>created a plugin that provides a balloon prototype tool tip. For
>>>>example, if I have the following defined in a header file
>>>>        
>>>>
>>(<filename>.h:
>>    
>>
>>>>void ThisRoutine (long first, long second, double third);
>>>>
>>>>and I was adding a function in the source file (<filename>.cpp):
>>>>
>>>>I would start typing:
>>>>
>>>>ThisRou
>>>>
>>>>and get a balloon that told me what the parameter list is.
>>>>        
>>>>
>>>
>>>My flist program,  available at
>>>http://mysite.verizon.net/astronaut/src/index.html ,
>>>      
>>>
>>analyzes C source
>>    
>>
>>>files
>>>(and C++ too, although it doesn't handle templates) and generates
>>>"hints" files.  I have a map...
>>>
>>> nmap <silent> <F4>  :so $HDR/hints<bar>echomsg "hints loaded"<CR>
>>>
>>>which I use to source (load) the hints file.  Then, when I type  
>>>myfunction(  a copy of the prototype shows
>>>up as an echoed message for the "myfunction" function.  To generate
>>>hints with flist:
>>>
>>> flist -h *.c ...
>>>
>>>or use recursive descent down a directory tree:
>>>
>>> flist -rh /path/to/some/directory
>>>
>>>You'll need to compile flist yourself, though.
>>>
>>>Regards,
>>>Chip Campbell
>>>
>>>
>>>
>>>      
>>>
>>I gave your program a try and it seems quite promising, but after
>>generating and sourcing the hints file, I couldn't see any
>>tips echoed.
>>I suppose they are immediatelly overwritten by '--INSERT--' status
>>message. Is any additional setup of Vim required to make it work?
>>
>>    
>>
>
>You could try increasing &cmdheight or unsetting &showmode.
>
>:h 'ch'
>:h 'smd'
>
>-Keith
>
>
>
>
>  
>
Ok, it seems to work. Unfortunatelly the program is choking on things
like /usr/include/string.h probably because of the __THROW__ modifiers.
The same applies to C++ function with throw([...]) lists appended to
them. Will Dr Chip fix this?