对, 那么正则替换方式,可以在snippets片段中实现吗?
具体实现方式:在反引号( ` )执行emacs脚本
获取文件路径:`file-attributes (buffer-file-name)`
获取buffer名称:`(file-name-nondirectory buffer-file-name)`
获取当前时间戳:
1. `(current-time-string)`
2. `(format-time-string "<%Y-%m-%d %H:%M>" (current-time))`
Emacs-Lisp code can be embedded inside the template, written inside back-quotes (`). The lisp forms are evaluated when the snippet is being expanded. The evaluation is done in the same buffer as the snippet being expanded.