在visual studio代码中
如何在alt+ctrl+ '我正在搜索要放入keybindings.json中的特定命令{
"key": "alt+ctrl+'",
"command": "????????????command?????????????",
"when": "editorTextFocus && !editorReadonly"
}
我想您希望Ctrl+Alt+' 通常情况下, 因此,如果您只想要一个backtick,请使用{
"key": "ctrl+alt+'",
// "command": "type", // normally this would work
// "args": {"text":"`"},
// "command": "editor.action.insertSnippet", // this outs just one backtick
// "args": {
// "snippet": "`"
// },
"command": "editor.action.insertSnippet",
"args": {
"snippet": "`$TM_SELECTED_TEXT`" // use this to wrap selected text with backticks
},
"when": "editorTextFocus && !editorReadonly"
},
type
命令是您在这里使用的,但由于它输出一个backtick,vscode会自动添加另一个-就像键入一个">输出两个一样。除非您将Editor > Auto Closing Quotes
设置为never
,否则这将影响所有引号,而不仅仅是backtick。insertSnippet
命令版本——它只输出一个backstick。