且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Sublime Text:如何制作插入文本的快捷方式?

更新时间:2023-01-31 12:49:37

在Sublime的首选项下选择键绑定-用户项目,然后添加以下示例行: /p>

Select the Key Bindings - User item under Sublime's Preferences, then add the following example line:

{"keys": ["ctrl+shift+c"], "command": "insert_snippet", "args": {"contents": "hello!"}}

这将添加 CTRL + SHIFT + C 快捷方式以插入 hello!代码段.

This will add a CTRL+SHIFT+C shortcut to insert the hello! snippet.

顺便说一句,不要忘了在前一个键绑定哈希中添加逗号,以便除最后一行以外的所有行都以逗号结尾.即:

By the way, don't forget to add a comma to the previous key binding hash so that all but the last line end with a comma. i.e.:

[
    {"keys": ["..."], "command": "..." },
    {"keys": ["..."], "command": "..." },
    {"keys": ["..."], "command": "..." },
    {"keys": ["ctrl+shift+c"], "command": "insert_snippet", "args": {"contents": "hi!"}}
]