【发布时间】:2017-09-12 19:15:35
【问题描述】:
有没有办法像使用 notepad++ 一样在 atom 和 sublime 中创建自己的缩写?
例如: 我有一大段代码:
<!DOCTYPE html>
<html>
blah... blah... blah...
</html>
使用记事本++,我可以使用快捷方式将其包装为缩写(例如:html),下次我可以输入html 并展开它,它会弹出所有代码。而不是像 Sublime 中的所有$>>>>**。
我已经在网上阅读了很多关于 sublime 和 atom 的手册,但老实说,我仍然不明白。
更新:
Sublime > Tools > Developer > New Snippet...
<snippet>
<content><![CDATA[
<!DOCTYPE html>
<html>
Blah blah blah
</html>
]]></content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<tabTrigger>html-blah</tabTrigger>
<!-- Optional: Set a scope to limit where the snippet will trigger -->
<scope>source.python</scope>
</snippet>
所以成功保存sn-p后,我输入html-blah,没有tab选项。
【问题讨论】: