VSCode 行尾添加分号并换行
文章目录
1. VSCode的扩展中安装macros
2. settings.json 内添加下列代码:
"macros": {
"addSemicolonToLineEndAndThenWrap": [
"cursorLineEnd",
{
"command": "type",
"args": {
"text": ";"
}
},
"editor.action.insertLineAfter"
]
}3. C:\Users\xxxxx\AppData\Roaming\Code\User\keybindings.json 内添加下列代码:
{
"key": "shift+enter",
"command": "macros.addSemicolonToLineEndAndThenWrap",
"when": "editorTextFocus && !editorReadonly"
}若要实现其他功能可自行修改。参考网址:
macros概述
VSCode键盘绑定
评论
登录后参与技术讨论,分享你的经验与见解。
登录 / 注册暂无评论