自动函数插入的 Vim 脚本
假设我有一个在文件 evil_lair.hh
中声明的类 evilLord
,并在文件 evil_lair.cc
中实现。现在,我想添加函数 bool minionDo(std::string command)
。是否有任何脚本可以自动将声明和空函数定义放入相应的文件中?
我正在使用 c-support
vim-plugin,我发现它很有用。也许这可以作为一个功能添加到这个脚本中......
Say I have a class evilLord
declared in the file evil_lair.hh
and is implemented in the file evil_lair.cc
. Now, I want to add the function bool minionDo(std::string command)
. Is there any script which will put the declaration and empty function definition in the respective files automatically?
I am using c-support
vim-plugin which I find useful. Maybe this can be added as a functionality to this script...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果我们想正确报告函数的范围,那么任务就不是那么简单了。我已经在我的 lh-cpp ftplugin 套件。
The task is not that trivial -- if we want to correctly report the scope of the function. I've already done the work in my
:GOTOIMPL
(and:MOVEIMPL
) command, from my lh-cpp ftplugin suite.这是一个可以工作的脚本:
Here is a script which will work: