Vim 中的语法提示
我已经使用 Vim 有一段时间了,虽然代码完成(全能、字典等)工作得很好,但我错过了一件事。
语法提示,所以基本上我想知道一个函数接受什么参数,而不是在网上查找它,我想把它放在 Vim 中的某个地方,最好是在当前行上方的框中或其他地方。
有什么方法可以实现这一点,我主要使用 PHP、Python 和 C++,所以我需要它来实现这些语言。
编辑:我确实已经安装了 ctags,但据我所知它没有提供语法提示,尝试使用 PHP 标准函数,不知道我是否忽略了某些内容。
还可以选择使用 snipMate 并输入所有标准库函数,但这需要大量工作,我会想象有人已经这样做了(是的,有类似 ultiSnips 的东西可以这样做,但它不如 snipMate)
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)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
从听起来的方式来看,我认为您正在寻找
setcompleteopt+=preview
。更多信息可以在:helpcompleteopt
中找到。From the way it sounds I think you are looking for
set completeopt+=preview
. More information can be found at:help completeopt
.我认为插件 echofunc 可以做到这一点。
当你编写代码时,按下
(
后,函数原型显示在状态栏中。
另请检查插件 srcexpl.vim 我认为它做了类似的事情(我不过不要经常使用它)。
I think the plugin echofunc does that.
When you are writing code, after you press
(
the functionprototype is displayed in the statusbar.
Check also the plugin srcexpl.vim which I think does something similar (I don't use it much though).