快速标记(https://github.com/redmunds/brackets-quick-markup)是Brackets IDE用于HTML开发的扩展。可以使用快捷键Ctrl + Alt + M激活扩展名。当它处于活动状态时,我们可以使用自定义快捷方式插入自定义HTML标记,而不是键入它们。例如,要在单词周围插入<b></b>
标签,我们只需选择单词并按Ctrl + B.可以自定义快捷方式及其相应的标签。
我在Visual Studio Code中寻找类似的扩展或功能。我试过搜索但到目前为止找不到任何东西。
keybindings.json
{
"key": "ctrl+b",
"command": "editor.emmet.action.wrapWithAbbreviation",
"when": "editorHasSelection",
"args": {
"abbreviation": "b"
}
},
{
"key": "ctrl+shift+b",
"command": "editor.emmet.action.wrapWithAbbreviation",
"when": "editorHasSelection",
"args": {
"abbreviation": "pre>code"
}
},
您也可以在没有args
的情况下调用它,并且每次都只需键入标签。
或者只输入任何东西:
{
"key": "ctrl+b",
"command": "editor.action.insertSnippet",
"args": {
"snippet": "<br />"
}
}