yasnippet
来源:互联网 发布:王牌特工知乐txt下载 编辑:程序博客网 时间:2024/06/07 07:18
从textmate把snippet发扬光大以来,各大编辑器纷纷学习,emacs也开始有了snippet的扩展,从最初的snippet.el,smart-snippet,到现在的yasnippet。其中smart-snippet和yasnippet都是同一个作者的作品。这三个中我只用了yasnippet,不过它们应该是逐渐发展提高的,那么yasnippet应该是上前最好用的了。
yasnippet官方主页上有两个发布包:yasnippet和yasnippet-bundle,区别在于yasnippet-bundle里带了很多预定的snippets,只要load-library<RET>yasnippet-bundle<RET>就直接可以使用了,yasnippet里也带了同样的snippets,不过是放在单独的文件夹里,要使用的话需要在.emacs中写入:
(require 'yasnippet) ;; not yasnippet-bundle
(yas/initialize)
(yas/load-directory "/path/to/the/snippets/directory/")
它的好处是可以自定义snippets,只要放在/path/to/the/snippets/directory/中就可以了,yasnippet会自动load的。
不过对于我这种懒人而言,根本不会去自定义snippets,所以只需要拷贝一个yasnippet-bundle.el,然后在emacs中load就用了。yasnippet使用tab键进行扩展,比如在c++-mode下,写一个class按tab,它自动就扩展出一个class的模板了。yasnippet带有菜单,在各种mode下支持哪些snippets,以及缩写词是什么直接看下菜单就知道了。
- yasnippet
- Yasnippet
- emacs yasnippet cperl
- Yasnippet & html-helper-mode
- emacs下yasnippet小结
- emacs添加yasnippet插件
- auto-complete & cedet & ecb & yasnippet
- Emacs: How to Define Templates in YASnippet
- yasnippet模板中使用elisp语句
- Emacs高效的yasnippet 简单使用和定制
- yasnippet 0.7.0和auto-complete-mode一起使用
- emacs 24 IDE配置(YASnippet、ECB、Cedet、Auto-complete)
- emacs下C/C++自动补全,Yasnippet && auto-complete && auto-complete-clang-async
- emacs自动补全插件auto-complet和yasnippet,安装、配置和扩展
- emacs下C/C++自动补全 之 使用Yasnippet模板补全 以自定义USACO模板为例
- 我使用的几个emacs扩展
- emacs中使用五笔
- junit使用简明手册
- emacs使用semantic
- 不平凡的一天
- yasnippet
- 发文预告^_^#
- 在MacOS X下编译emacs23
- imenu不能创建objc的tag的问题
- emacs的列模式
- ediff
- 使用jde编辑java
- IT餐馆—第三回 模式
- dotnet之反编译器与模糊器