我剛從 PhpStorm 遷移到 VS Code,還有一些我不習慣的東西。
當我用游標注釋一行時,Ctrl /它會停留在該行中。我希望我的游標移動到下一行(就像它在 PhpStorm 中所做的那樣)。
關于如何在評論一行后添加此“轉到下一行”操作的任何想法?
uj5u.com熱心網友回復:
使用這個鍵系結(在你的keybindings.json)和宏擴展multi-command:
{
"key": "ctrl /", // whatever you want
"command": "extension.multiCommand.execute",
"args": {
"sequence": [
"editor.action.commentLine", // for line comments
"editor.action.insertLineAfter"
// "cursorDown"
]
},
"when": "editorTextFocus"
},
{
"key": "shift alt A", // whatever keybinding you want
"command": "extension.multiCommand.execute",
"args": {
"sequence": [
"editor.action.blockComment", // for block comments too
"editor.action.insertLineAfter"
// "cursorDown"
]
},
"when": "editorTextFocus"
}
唯一的缺點是當您取消注釋時它也會插入一行。如果您只想插入一行,而不是插入一行(其中可能有預先存在的文本,請改用該命令"cursorDown"。
轉載請註明出處,本文鏈接:https://www.uj5u.com/net/431504.html
標籤:视觉工作室代码
上一篇:VScode為隨機線添加一些顏色
