我刚从Sublime过渡到VS Code并喜欢它。想知道是否有相同的组合或设置方法,用于跳跃/选择线块,向下/向上到下一个空白行。这就是ST3中对我来说的样子:
{"keys": ["ctrl+shift+["], "command": "move", "args": {"by": "stops", "empty_line": true, "forward": false, "extend": true}},
{"keys": ["ctrl+shift+]"], "command": "move", "args": {"by": "stops", "empty_line": true, "forward": true, "extend": true}},
{"keys": ["ctrl+{"], "command": "move", "args": {"by": "stops", "empty_line": true, "forward": false, "extend": true}},
{"keys": ["ctrl+}"], "command": "move", "args": {"by": "stops", "empty_line": true, "forward": true, "extend": true}},
答案 0 :(得分:2)
The following plugin meets your requirments I believe
引用插件说明
在文本编辑器中移动代码,方法是将代码“段落”跳转到最接近的空行,或者选择沿途选择文本。
提供了以下命令和相应的默认键绑定:
block-travel.jumpUp: alt+up
block-travel.selectUp: alt+shift+up
block-travel.jumpDown: alt+down
block-travel.selectDown: alt+shift+down
答案 1 :(得分:1)
这是针对 v1.54 的 Insiders 版本,没有扩展。 prevBlankLine
和 nextBlankLine
to
值已添加到 cursorMove
命令。见https://github.com/microsoft/vscode/pull/115578。
{
"key": "ctrl+shift+[", // whatever keybinding you want
"command": "cursorMove",
"args": {
"to": "prevBlankLine",
"select": true
},
"when": "editorTextFocus"
},
{
"key": "ctrl+shift+]",
"command": "cursorMove",
"args": {
"to": "nextBlankLine",
"select": true
},
"when": "editorTextFocus"
},