如何设置插入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}"
}
}
]
按下
console.log()
时,将alt+d
插入当前光标位置。引用:https://gist.github.com/harthur/2951063
关于sublimetext2 - 如何在Sublime Text中使用键盘快捷键插入一小段文本?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24186786/