Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
// vscode-keybindings for navigation with I/J/K/L and additional functionality with surrounding characters
// Place your key bindings in this file to overwrite the defaults
// ALT + I/J/K/L: up/left/down/right
// ALT + SHIFT + I/J/K/L: mark text up/left/down/right
// CTRL + J/L: send cursor to start/end of line
// CTRL + ALT + J/L: send cursor to start/end of word
// CTRL + ALT + U/O: send cursor to "wordPartLeft"/"wordPartRight"
// CTRL + ALT + SHIFT + U/O: mark from cursor to "wordPartLeft"/"wordPartRight"
// CTRL + ALT + Y: got to declaration
// CTRL + I/K: add/remove another cursor up/down
// -- IF LINEJUMPER IS INSTALLED -- //
// CTRL + ALT + I/K: move cursor 10 lines up/down
// CTRL + ALT + SHIFT + I/K: mark 10 lines up/down
[
{
"key": "ctrl+shift+i",
"command": "editor.action.moveLinesUpAction",
"when": "editorTextFocus"
},
{
"key": "ctrl+shift+k",
"command": "editor.action.moveLinesDownAction",
"when": "editorTextFocus"
},
{
"key": "alt+k",
"command": "cursorDown",
"when": "editorTextFocus"
},
{
"key": "alt+i",
"command": "cursorUp",
"when": "editorTextFocus"
},
{
"key": "alt+l",
"command": "cursorRight",
"when": "editorTextFocus"
},
{
"key": "alt+j",
"command": "cursorLeft",
"when": "editorTextFocus"
},
{
"key": "alt+shift+k",
"command": "cursorDownSelect",
"when": "editorTextFocus"
},
{
"key": "alt+shift+i",
"command": "cursorUpSelect",
"when": "editorTextFocus"
},
{
"key": "alt+shift+l",
"command": "cursorRightSelect",
"when": "editorTextFocus"
},
{
"key": "alt+shift+j",
"command": "cursorLeftSelect",
"when": "editorTextFocus"
},
{
"key": "alt+ctrl+l",
"command": "cursorWordEndRight",
"when": "editorTextFocus"
},
{
"key": "alt+ctrl+j",
"command": "cursorWordStartLeft",
"when": "editorTextFocus"
},
{
"key": "alt+shift+ctrl+l",
"command": "cursorWordRightSelect",
"when": "editorTextFocus"
},
{
"key": "alt+shift+ctrl+j",
"command": "cursorWordLeftSelect",
"when": "editorTextFocus"
},
{
"key": "alt+shift+o",
"command": "cursorEndSelect",
"when": "editorTextFocus"
},
{
"key": "alt+shift+u",
"command": "cursorHomeSelect",
"when": "editorTextFocus"
},
{
"key": "ctrl+l",
"command": "cursorEnd",
"when": "editorTextFocus"
},
{
"key": "ctrl+j",
"command": "cursorHome",
"when": "editorTextFocus"
},
{
"key": "ctrl+alt+y",
"command": "editor.action.goToDeclaration"
},
{
"key": "ctrl+i",
"command": "cursorColumnSelectUp",
"when": "editorTextFocus"
},
{
"key": "ctrl+k",
"command": "cursorColumnSelectDown",
"when": "editorTextFocus"
},
{
"key": "alt+shift+ctrl+o",
"command": "cursorWordPartRightSelect",
"when": "textInputFocus"
},
{
"key": "alt+shift+ctrl+u",
"command": "cursorWordPartLeftSelect",
"when": "textInputFocus"
},
{
"key": "alt+ctrl+o",
"command": "cursorWordPartRight",
"when": "textInputFocus"
},
{
"key": "alt+ctrl+u",
"command": "cursorWordPartLeft",
"when": "textInputFocus"
},
{
"key": "alt+ctrl+k",
"command": "lineJumper.moveDown",
"when": "editorTextFocus"
},
{
"key": "alt+ctrl+i",
"command": "lineJumper.moveUp",
"when": "editorTextFocus"
},
{
"key": "alt+shift+ctrl+k",
"command": "lineJumper.selectDown",
"when": "editorTextFocus"
},
{
"key": "alt+shift+ctrl+i",
"command": "lineJumper.selectUp",
"when": "editorTextFocus"
}
]
@blQSheep

This comment has been minimized.

Copy link

@blQSheep blQSheep commented May 16, 2021

Love this! The only keybindings i use

@yoseptara

This comment has been minimized.

Copy link

@yoseptara yoseptara commented Jul 13, 2021

Niceee, thankyou

@sundiip

This comment has been minimized.

Copy link

@sundiip sundiip commented Aug 11, 2021

Thanks. very helpful.

@MostafaDe

This comment has been minimized.

Copy link

@MostafaDe MostafaDe commented Aug 13, 2021

great, thanks for sharing :)

@Dras227

This comment has been minimized.

Copy link

@Dras227 Dras227 commented Aug 31, 2021

Thanks for sharing...very helpful

@Dras227

This comment has been minimized.

Copy link

@Dras227 Dras227 commented Aug 31, 2021

I tried it.
Every other thing works execept alt+L for me.
And generally also i cant record the keybinding of alt+L.
any idea??

@auna93

This comment has been minimized.

Copy link

@auna93 auna93 commented Sep 15, 2021

Thanks, I will give it a try.
So far, I had to change the default Delete Line command to ctrl +d ctrl +d.
Getting used to it.

@Dras227

This comment has been minimized.

Copy link

@Dras227 Dras227 commented Sep 15, 2021

Instead of this using powertoys is a much better
and easier to approach.

@sundiip

This comment has been minimized.

Copy link

@sundiip sundiip commented Sep 16, 2021

  1. Alt + Shift + U/O : [Selection] Select characters from cursor to start/end of line
  2. Alt + U/O : [Navigation] Move cursor to start/end of line
  3. Alt + i/J/K/L : [Navigation] Move cursor up/left/down/right
  4. Alt + Shift + i/J/K/L : [Selection] Select characters or lines
  5. Alt + Ctrl + i/K : [Line Action] Move, Move an entire line or selection up/down
  6. Alt + Ctrl + J/L : [Selection] smart Select shrink/expand
  7. Ctrl + i/K : [Cursors] Add a cursor above/below to the current cursor position
  8. Ctrl + L : [Line Action] Duplicate, entire line or selection, below current position.
  9. Ctrl + J : [Navigation] For jumpy [Extension]
  10. Alt + Y : [Navigation] got to declaration
  11. Alt + Shift + Y : [Navigation] navigate-Back from declaration
  12. Ctrl + 1 : Increment selection [Extension]
  13. Ctrl + Shift + E : [Cursors] insert cursors end of each line, on current selection
  14. Ctrl + D : [Line Action] [deletion] Delete the entire line
  15. Alt + H + Shift : [Selection] Select word
  16. Alt + H : [deletion] Backspace or deleteLeft
  17. Ctrl + H : [deletion] delete previous complete word

{
// to save all unsaved file in a current worksapce
"key": "ctrl+shift+s",
"command": "workbench.action.files.saveAll"
},
// ALT + I/J/K/L: up/left/down/right
{
"key": "alt+k",
"command": "cursorDown",
"when": "editorTextFocus"
},
{
"key": "alt+i",
"command": "cursorUp",
"when": "editorTextFocus"
},
{
"key": "alt+l",
"command": "cursorRight",
"when": "editorTextFocus"
},
{
"key": "alt+j",
"command": "cursorLeft",
"when": "editorTextFocus"
},
// ALT + SHIFT + I/J/K/L: mark text up/left/down/right
{
"key": "alt+shift+k",
"command": "cursorDownSelect",
"when": "editorTextFocus"
},
{
"key": "alt+shift+i",
"command": "cursorUpSelect",
"when": "editorTextFocus"
},
{
"key": "alt+shift+l",
"command": "cursorRightSelect",
"when": "editorTextFocus"
},
{
"key": "alt+shift+j",
"command": "cursorLeftSelect",
"when": "editorTextFocus"
},
// ALT + CTRL + I/K: Move, marked/current line up/down
{
"key": "alt+ctrl+i",
"command": "editor.action.moveLinesUpAction",
"when": "editorTextFocus"
},
{
"key": "alt+ctrl+k",
"command": "editor.action.moveLinesDownAction",
"when": "editorTextFocus"
},
{
// CTRL + J: for jumpy [Extension]
"key": "ctrl+j",
"command": "extension.jumpy-word",
"when": "editorTextFocus"
},
// CTRL + L: Copy, marked/current line up
{
"key": "ctrl+l",
"command": "editor.action.copyLinesUpAction",
"when": "editorTextFocus"
},
// Alt + Ctrl + J/L :editor.action.smartSelect.shrink/expand
{
"key": "alt+ctrl+j",
"command": "editor.action.smartSelect.shrink",
"when": "editorTextFocus"
},
{
"key": "alt+ctrl+l",
"command": "editor.action.smartSelect.expand",
"when": "editorTextFocus"
},
// CTRL + U/O : send/move cursor to start/end of line
{
"key": "alt+o",
"command": "cursorEnd",
"when": "editorTextFocus"
},
{
"key": "alt+u",
"command": "cursorHome",
"when": "editorTextFocus"
},
//CTRL + U/O + shift : Select/Mark characters from cursor to start/end of line
{
"key": "alt+shift+o",
"command": "cursorEndSelect",
"when": "editorTextFocus"
},
{
"key": "alt+shift+u",
"command": "cursorHomeSelect",
"when": "editorTextFocus"
},
// CTRL + I/K: Add a cursor above/below to the current cursor position
{
"key": "ctrl+i",
"command": "cursorColumnSelectUp",
"when": "editorTextFocus"
},
{
"key": "ctrl+k",
"command": "cursorColumnSelectDown",
"when": "editorTextFocus"
},
// alt + y: got to declaration
{
"key": "alt+y",
"command": "editor.action.goToDeclaration"
},
// shift + alt + y: navigateBack from declaration
{
"key": "shift+alt+y",
"command": "workbench.action.navigateBack"
},
{
// Increment Selection [extension]
"key": "ctrl+1",
"command": "extension.incrementSelection",
"when": "editorTextFocus"
},
{
//insert cursors to each line-ends, in selected lines/text
"key": "ctrl+shift+e",
"command": "editor.action.insertCursorAtEndOfEachLineSelected",
"when": "editorTextFocus"
},
{
// For running the current cell
"key": "shift+enter",
"command": "jupyter.execSelectionInteractive",
"when": "editorTextFocus && editorLangId == 'python'"
},
{
// For running the cell and create a new cell below
"key": "ctrl+enter",
"command": "jupyter.runcurrentcelladvance",
"when": "editorTextFocus && editorLangId == 'python'"
},
{
// Backspace or deleteLeft [default: Backspace]
"key": "alt+h",
"command": "deleteLeft",
"when": "textInputFocus"
},
{
// Select word [default keybinding: Ctrl + D]
"key": "alt+shift+h",
"command": "editor.action.addSelectionToNextFindMatch",
"when": "editorFocus"
},
{
// delete previous word [defalt: Ctrl + Backspace]
"key": "ctrl+h",
"command": "deleteWordLeft",
"when": "textInputFocus && !editorReadonly"
},
{
// Delete a line
"key": "ctrl+d",
"command": "editor.action.deleteLines",
"when": "editorTextFocus && !editorReadonly"
},
{ // Insert line below
"key": "ctrl+enter",
"command": "editor.action.insertLineAfter",
"when": "editorTextFocus && !editorReadonly"
},
{
// [replaced]
"key": "shift+alt+i",
"command": "-editor.action.insertCursorAtEndOfEachLineSelected",
"when": "editorTextFocus"
},
{
// [replaced]
"key": "ctrl+d",
"command": "-editor.action.addSelectionToNextFindMatch",
"when": "editorFocus"
},

@espenbjorkeng

This comment has been minimized.

Copy link
Owner Author

@espenbjorkeng espenbjorkeng commented Sep 16, 2021

  1. Alt + Shift + U/O : Select/Mark characters from cursor to start/end of line
  2. Alt + U/O : Move cursor to start/end of line
  3. Alt + i/J/K/L : Move cursor up/left/down/right
    (...)

Thanks for sharing!

Instead of this using powertoys is a much better
and easier to approach.

Yes, using Powertoys is a good alternative. At least if you want to remap keys across all applications.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment