tags:

views:

586

answers:

3

is there a way in vim to get a popup window with function parameters? (like in visual studio / slick edit)

e.g. when i type "function_name(" vim will open a popup window (like when doing ctrl-n in new versions) and show me the function parameters and which one of them i'm currently typing.

p.s.

  1. i'm looking for something a bit more comfortable than ctrl-w ctrl-]

  2. i'm also looking for a similar functionality that will show me list of available members when typing "var->" or "var."

  3. i'm using c

+3  A: 

Do check out the autocomplpop and TTrCodeAssistor plug-ins.

dirkgently
A: 

Check cream - it seems to have some C support. You'll need ctags.

A modern configuration of the powerful and famous Vim, Cream is now available for Microsoft Windows, GNU/Linux, and FreeBSD

... (Programmer Features)

  • Pop up prototype and information menu ( Alt+( ). View the function's prototype under the cursor without having to open the file with the definition.
gimel
+2  A: 

As was already suggested, install the autocomplpop plugin. Then, to trigger omincompletion as you type for C files, you could add the following to your .vimrc:

let g:AutoComplPop_Behavior = { 
\ 'c': [ {'command' : "\<C-x>\<C-o>",
\       'pattern' : ".",
\       'repeat' : 0}
\      ]  
\}

If you don't want to trigger omnicompletion for every character typed, change the pattern value to suit your needs. For information on how to further customize, look at the documentation in the comment header of autocomplpop.vim

Moreover, to get a popup window with function parameters also add the following to your .vimrc:

let g:AutoComplPop_CompleteoptPreview = 1

To make it work make sure you generated a tags file with ctags.

davitenio