8

I've been using Vim for quite a while now, and while the code-completion (omni, dictionary, etc) works fine I've been missing one thing.

Syntax-hinting, so basically I'd like to know what arguments a function accepts, rather than look it up online I'd like to have it somewhere in Vim, preferably in a box above the current line or something.

Is there any way to achieve this, I mostly work with PHP, Python and C++ so I need it for those languages.

Edit: I do already have ctags installed, but from what I could tell it didn't provide syntax-hinting, tried it with PHP standard functions, dunno if I've overlooked something.

There's also the option of using snipMate and entering all standard library functions, but that's a lot of work, would've imagined that someone already did that (And yes there's something like ultiSnips that does but it's inferior to snipMate)

Not Available
  • 3,095
  • 7
  • 27
  • 31
  • You could have a look at [ctags](http://ctags.sourceforge.net/). I haven't explored it myself, but I keep meaning to. I know that it is supposed to allow completion of struct members, and suchlike. Not sure if it can do function arguments though. – Prince Goulash May 11 '11 at 11:49
  • @Goulash Yeah I've already installed that, and while it does provide completion it doesn't seem to provide syntax hinting. – Not Available May 11 '11 at 12:15
  • 2
    I don't know for Python and C++ but in PHP, `` brings both a contextual menu with possible completions and a little window with the "prototype" of the method, including arg names and types. – romainl May 11 '11 at 12:29

2 Answers2

7

From the way it sounds I think you are looking for set completeopt+=preview. More information can be found at :help completeopt.

Randy Morris
  • 39,631
  • 8
  • 69
  • 76
2

I think the plugin echofunc does that. When you are writing code, after you press ( the function prototype is displayed in the statusbar.

Check also the plugin srcexpl.vim which I think does something similar (I don't use it much though).

skeept
  • 12,077
  • 7
  • 41
  • 52
  • Thanks for the tips, and it seems it does do what I want it to do, but there's 1 problem, which is ctags related, how do I get it to also show built-in/module functions from PHP/Python rather than just my own code? – Not Available May 13 '11 at 16:31
  • I don't know how exactly how to do that. I think you might want to ask a separate question for that. – skeept May 15 '11 at 01:18