Update: new functionality added to Insiders' Build v1.54 makes this quite easy now. See https://stackoverflow.com/a/66066852/836330 For example (in keybindings.json):
{
"key": "ctrl+up",
"command": "cursorMove",
"args": {
"to": "prevBlankLine",
// "select": true
},
"when": "editorTextFocus"
},
{
"key": "ctrl+down",
"command": "cursorMove",
"args": {
"to": "nextBlankLine",
// "select": true
},
"when": "editorTextFocus"
},
Previous answer:
This is pretty close. You will need an extension to do it. Select By - it also moves by an amount that can be determined by a regex.
In your settings.json:
"moveby.revealType": "InCenter",
"selectby.regexes": {
"goToEmptyLine": {
"flags": "m", // must use the "m" multiline flag for this regex
"moveby": "^\\s*$\\r?\\n", // an "empty" line, it may have spaces or tabs in it
// "forward": "(^\\s*$\\r?\\n)",
// "backward": "^\\s*$\\r?\\n"
}
}
and in your keybindings.json:
{
"key": "ctrl+up",
"when": "editorTextFocus",
"command": "moveby.regex",
"args": ["goToEmptyLine", "moveby", "prev", "start"]
},
{
"key": "ctrl+down",
"when": "editorTextFocus",
"command": "moveby.regex",
"args": ["goToEmptyLine", "moveby", "next", "start"]
},
In the up direction it does skip consecutive empty lines, but not in the down direction - it stops right after text but with more empty lines below but it does skip them moving to the next down target.
That last point might be fixable with a different regex (you can set different regex's for forward and backward). But what is presented is very close to what you want.