我如何设置插入console.log()
的快捷方式,并围绕我的当前选择在Sublime Text不安装任何插件或额外的第三方的东西?
我找到了答案。我想我应该在这里为其他人添加:
转到Sublime Text 2 > Preferences > Key Bindings - User
并将此JSON添加到文件中:
[
{ "keys": ["alt+d"],
"command": "insert_snippet",
"args": {
"contents": "console.log(${1:}$SELECTION);${0}"
}
}
]
按下alt+d
,在光标当前位置插入一个console.log()
。
参考:https://gist.github.com/harthur/2951063