Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Syntax hinting in Vim

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)

like image 204
Not Available Avatar asked May 11 '11 11:05

Not Available


People also ask

How does vim do syntax highlighting?

Syntax highlighting is on for vim editor by default. The content of login.sh will be displayed with the following format when the syntax highlighting is on. After opening login.sh file in vim editor, press ESC key and type ':syntax on' to enable syntax highlighting.

Where is syntax vim?

If you are wondering where you can find these syntax highlighting files, you can check the following directory. $ ls /usr/share/vim/vim73/syntax ... config. vim idl.

How do I turn off color in vim?

You can change color schemes at anytime in vi by typing colorscheme followed by a space and the name of the color scheme. For more color schemes, you can browse this library on the vim website. You can enable or disable colors by simply typing "syntax on" or "syntax off" in vi.


2 Answers

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

like image 59
Randy Morris Avatar answered Oct 09 '22 22:10

Randy Morris


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).

like image 33
skeept Avatar answered Oct 09 '22 23:10

skeept