You need to bind cursorMove
command with proper args. To bind:
- selecting from cursor to next blank line with Ctrl + Shift + Down
- selecting from cursor to previous blank line with Ctrl + Shift + Up
you can use:
{
"key": "ctrl+shift+down",
"command": "cursorMove",
"when": "editorTextFocus",
"args": {
"to": "nextBlankLine",
"select": true
}
},
{
"key": "ctrl+shift+up",
"command": "cursorMove",
"when": "editorTextFocus",
"args": {
"to": "prevBlankLine",
"select": true
}
}
Add it to keybindings.json
by e.g. executing Command Palette (Shift + Ctrl + P) -> Preferences: Open Keyboard Shortcuts (JSON) command.
As a bonus, to bind one shortcut to select an entire paragraph, as the title of the question suggests, a runCommands
macro can be used:
{
"key": "ctrl+shift+a",
"command": "runCommands",
"when": "editorTextFocus",
"args": {
"commands": [
{
"command": "cursorMove",
"args": {
"to": "prevBlankLine"
}
},
{
"command": "cursorMove",
"args": {
"to": "nextBlankLine",
"select": true
}
}
]
}
}
Check cursorMove documentation for more info.
Ctrl+Shift+DownArrow
) or previous empty line (withCtrl+Shift+UpArrow
).