1 Tools->Developer->New Plugin 建立新插件
2 写入以下代码(自定义注释功能的)
import datetime
import sublime, sublime_plugin
class AddClassNote(sublime_plugin.TextCommand):
def run(self, edit):
self.view.run_command("insert_snippet",
{
"contents": "/**""\n"
" * @Description: Description""\n"
" * @Author: xilongtao,xilongtao@sporte.cn""\n"
" * @DateTime: " "%s" %datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S") +"\n"
" */"
}
)
3 Preferences->Key Bindgs - User,绑定快捷键,写入配置
[
{
"command": "add_class_note",//值是第二步文件名单词使用_分割的字符串
"keys": [
"ctrl+shift+c"
]
}
]