如何使用键绑定在Mac OS的Visual Studio代码中插入代码?例如在Sublime中,我可以像这样插入console.log
:
{
"keys": ["super+shift+l"],
"command": "insert_snippet",
"args": {
"contents": "console.log('test:' + varname);${0}"
}
},
如果我按 Cmd + Shift + L 我得到console.log('test:' + varname);
答案 0 :(得分:2)
您可以指定insertSnippet
命令应该插入的内容:
{
"key": "cmd+shift+l",
"command": "editor.action.insertSnippet",
"args": {
"snippet": "console.log('test:' + varname);${0}"
}
}