然后在配置文件中加入:
(require 'yasnippet) (yas/global-mode 1)
# name: usaco ... { ... } # key: usaco # -- /* ID:twd30651 PROG:${1:programname} LANG:C++ */ #include<iostream> #include<fstream> using namespace std; int main(int argc,char *argv[]) { freopen("${1:$(yas-substr yas-text "[^: ]*")}.in","r",stdin); //freopen("${1:$(yas-substr yas-text "[^: ]*")}.out","w",stdout); $0 return 0; }
emacs下C/C++自动补全 之 使用Yasnippet模板补全 以自定义USACO模板为例
原文地址:http://blog.csdn.net/wdkirchhoff/article/details/43196267