通过omnicppcomplete选择func后如何获取func原型?
有没有办法让vim在通过omnifunc选择函数后粘贴函数的参数(或者至少在选择它之后显示它,但不是之前)? 类似于:
myObject.play(int time, std::string foo)
甚至可能允许您通过选项卡浏览参数,就像那些片段插件允许您执行的操作一样。
有这样的插件或功能吗? 我认为这非常有用。
顺便说一句,omnifunc 的预览选项非常慢,并且在选择函数后不会显示。
Is there a way to get vim to paste a function's arguments after selecting it via omnifunc (or at least displaying it after selecting it, but not before)? Something like:
myObject.play(int time, std::string foo)
Maybe even allows you to tab through the arguments like what those snippets plugins allow you to do.
Is there such a plugin or feature? I think this is extremely useful.
BTW, omnifunc's preview option is very slow and will not show up after you select a function.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
尝试 code_complete。
它使用 ctags 来完成函数签名,并允许您循环浏览参数列表。 它也可以完成其他东西 - 标准头文件、for()/switch() 块等。
Try code_complete.
It uses ctags to complete a function signature and allows you to cycle through the arguments list. It can complete other stuff as well - standard header files,
for()
/switch()
blocks etc.你可以从 vim 网站获取 snippetsEMU 插件,然后设置该函数的自定义片段如下:
This way all you have to do is type play and hit the tab key to have it expanded the curly braces will allow you to tab through the the args. Hope this is what you're looking for...
you could get the snippetsEMU plugin from the vim website then set up a custom snippet for that function like this:
This way all you have to do is type play and hit the tab key to have it expanded the curly braces will allow you to tab through the the args. Hope this is what you're looking for...