Step1: 安装SnippetMaker工具包
Mac: Shift + Command + P
: Install Package
: SnippetMaker
: 点击安装
Win: Shift + Control + P
: Install Package
: SnippetMaker
: 点击安装
如果还需要自动补全代码再安装:
- LaTex-cwl
- LaTexSmartQuotes
- LaTeXTab
- LaTeXTools
Step2: 选中代码片创建snnipet
- 选中代码片段
- 打开控制面板
- Mac:
Shift + Command + P
- Win:
Shift + Control + P
- 输入
make snippet
Step3: 编辑Snnipet
- Triggle: 输入你想要的Snnipet的名称,例如
latex
- Descrption: 输入对snnipet的相关描述, 例如
latex snnipet
- Scope: 指定范围
- File Name: 指定snnipet的文件名称
- 回车:查看snnipet的内容
Step4: 使用Snnipet
- 在任意文件中输入Triggle中指定的名称
- Tab确认
- 自动加载
- 恭喜!
SnippetMaker for Sublime Text 2 and 3
Makes managing snippets easy. Create snippets on the fly, and manage them without digging into a file manager:
- Select text and use Make Snippet via the Command Palette to make a new snippet.
- Edit Snippet let’s you select a snippet file to open and edit. (ST3+ only)
- Use Delete Snippet to send a snippet you no longer need to the trash.
Ref: https://packagecontrol.io/packages/SnippetMaker