emacs 功能类似于 netbeans 模板吗?
在 netbeans 中,您可以将一些代码存储为模板,并在需要时通过键入特定单词和 TAB 来调用它。是否有类似的 emacs 功能,如果有,我该如何使用它? 提前致谢!
In netbeans you can store some code as template and call it back whenever you like by typing a specific word and TAB..is there a similar emacs feature, and if yes how can I use it?
thanks in advance!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
emacs 附带了几个提供此类功能的库。 SkeletonMode 和 TempoMode 都允许您将模板插入代码中。它们可以与 AbbrevMode 结合使用,自动触发关键字,就像在 NetBeans 中一样。
Yasnippet 是一个功能更全面的库,可以执行相同的操作,捆绑了许多默认值各种语言。目前它没有与 emacs 捆绑在一起。
There are a couple of libraries that come with emacs that provide this kind of functionality. SkeletonMode and TempoMode both allow you to insert templates into your code. They can be combined with AbbrevMode to automatically trigger on keywords, like in NetBeans.
Yasnippet is a much more full-featured library to do the same, bundled with lots of defaults for various languages. It is not currently bundled with emacs.
是的,看看这里:http://code.google.com/p/yasnippet
另外,您可以观看此视频:http://www.youtube.com/watch?v=76Ygeg9miao
Yes, take a look here : http://code.google.com/p/yasnippet
In addition, you can watch this video : http://www.youtube.com/watch?v=76Ygeg9miao
当我通过语音进行大量编程时,我曾经非常频繁地使用 ELSE 模式。
I used to use ELSE Mode very heavily when I was doing a lot of programming by voice.