问题
I just transitioned from Sublime to VS Code and love it. Wondering if there are equivalent combos, or a way to set them, for jumping/selecting chunks of line, down/up to the next blank line. This is what these looked like for me in 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}},
回答1:
The following plugin meets your requirments I believe
Quote from plugin description
Travel in a text editor by jumping over code "paragraphs", to the closest empty line, optionally selecting text along the way.
The following commands and corresponding default keybindings are provided:
block-travel.jumpUp: alt+up
block-travel.selectUp: alt+shift+up
block-travel.jumpDown: alt+down
block-travel.selectDown: alt+shift+down
回答2:
This is in the Insiders' Build for v1.54 without an extension. prevBlankLine
and nextBlankLine
to
values have been added to the cursorMove
command. See 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"
},
来源:https://stackoverflow.com/questions/45788119/is-there-a-vs-code-shortcut-to-move-select-up-down-to-the-next-empty-line