我有一些自定义快捷键可以用cmd+up
和cmd+down
移动,间隔5行。
{
"key": "cmd+up",
"command": "cursorMove",
"args": {
"to": "up",
"by": "line",
"value": 5
},
"when": "editorTextFocus"
},
{
"key": "cmd+down",
"command": "cursorMove",
"args": {
"to": "down",
"by": "line",
"value": 5
},
"when": "editorTextFocus"
},
我想要的是当按下shift+cmd+[up,down]
选择5行上下时。我发现有一些“命令”,如{cursorDownSelect
,cursorPageDownSelect
,CursorEndSelect
},但是没有一个命令允许我定义一些arg来跳过几行,有人知道怎么做吗?
发布于 2022-07-18 15:49:25
可以将select
选项添加到cursorMove
命令中。在此命令页搜索cursorMove
:https://code.visualstudio.com/api/references/commands
{
"key": "cmd+up",
"command": "cursorMove",
"args": {
"to": "up",
"by": "line",
"value": 5
"select": true // the default is false
},
"when": "editorTextFocus"
},
{
"key": "cmd+down",
"command": "cursorMove",
"args": {
"to": "down",
"by": "line",
"value": 5,
"select": true
},
"when": "editorTextFocus"
}
https://stackoverflow.com/questions/73024798
复制相似问题