Microsoft VS Code - Jump 10 lines vertically at once
Put this into keybindings.json
{
"key": "ctrl+up",
"command": "cursorMove",
"args": {
"to": "up",
"by": "line",
"value": 10
},
"when": "editorTextFocus"
},
{
"key": "ctrl+down",
"command": "cursorMove",
"args": {
"to": "down",
"by": "line",
"value": 10
},
"when": "editorTextFocus"
},
cursorMove
- Move cursor to a logical position in the view
args:
to
: A mandatory logical position value providing where to move the cursor.
'left', 'right', 'up', 'down', 'prevBlankLine', 'nextBlankLine',
'wrappedLineStart', 'wrappedLineEnd', 'wrappedLineColumnCenter'
'wrappedLineFirstNonWhitespaceCharacter', 'wrappedLineLastNonWhitespaceCharacter'
'viewPortTop', 'viewPortCenter', 'viewPortBottom', 'viewPortIfOutside'
by
: Unit to move. Default is computed based on 'to' value.
'line', 'wrappedLine', 'character', 'halfLine'
value
: Number of units to move. Default is '1'
select
: If 'true' makes the selection. Default is 'false'.
https://code.visualstudio.com/api/references/commands
For QMK users
You can get the ability to move 10 lines anywhere (not just vsCode) by programming macros on your keyboard.
Do take a look at the documentation about macros as I'm certainly forgetting details, but a minimal example looks like this:
// keymap.c
// ...lots of #includes and #defines
enum custom_keycodes {
TENDOWN,
TENUP,
};
// use TENDOWN and TENUP in your keymaps
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
switch(keycode) {
case TENUP:
if (record->event.pressed) {
SEND_STRING(
SS_TAP(X_UP)
SS_TAP(X_UP)
SS_TAP(X_UP)
SS_TAP(X_UP)
SS_TAP(X_UP)
SS_TAP(X_UP)
SS_TAP(X_UP)
SS_TAP(X_UP)
SS_TAP(X_UP)
SS_TAP(X_UP)
);
}
break;
case TENDOWN:
if (record->event.pressed) {
SEND_STRING(
SS_TAP(X_DOWN)
SS_TAP(X_DOWN)
SS_TAP(X_DOWN)
SS_TAP(X_DOWN)
SS_TAP(X_DOWN)
SS_TAP(X_DOWN)
SS_TAP(X_DOWN)
SS_TAP(X_DOWN)
SS_TAP(X_DOWN)
SS_TAP(X_DOWN)
);
}
break;
}
return true;
}
Just install line-jumper by alekseychaikovsky
It does everything as Sublime did for BOTH jumping lines AND selecting them as you jump.
The "cursorMove" solution in keybindings.json does NOT select lines and also is a tedious task. Just install extension "line-jumper" and you are done.