Skip to content

Instantly share code, notes, and snippets.

@mt40
Last active August 28, 2016 01:46
Show Gist options
  • Save mt40/a2bc1d55584f19cdd804ef2b3d15f261 to your computer and use it in GitHub Desktop.
Save mt40/a2bc1d55584f19cdd804ef2b3d15f261 to your computer and use it in GitHub Desktop.
My custom VSCODE key bindings
// Place your key bindings in this file to overwrite the defaults
[
/**
* Group: Editing
* Prefix: ctrl+e
*/
// Section: new bindings
{
"key": "ctrl+e ctrl+f",
"command": "editor.action.format",
"when": "editorTextFocus"
},
{
"key": "ctrl+e ctrl+d",
"command": "editor.action.deleteLines",
"when": "editorTextFocus"
},
{
"key": "ctrl+e ctrl+/",
"command": "editor.action.commentLine",
"when": "editorTextFocus"
},
{
"key": "ctrl+e ctrl+b",
"command": "editor.action.blockComment",
"when": "editorTextFocus"
},
{
"key": "ctrl+e ctrl+r",
"command": "editor.action.rename",
"when": "editorTextFocus"
},
{
"key": "alt+down",
"command": "editor.action.moveLinesDownAction",
"when": "editorTextFocus"
},
{
"key": "alt+up",
"command": "editor.action.moveLinesUpAction",
"when": "editorTextFocus"
},
{
"key": "ctrl+e ctrl+h",
"command": "editor.action.selectHighlights",
"when": "editorFocus"
},
{
"key": "ctrl+e ctrl+l",
"command": "expandLineSelection",
"when": "editorTextFocus"
},
{
"key": "ctrl+e ctrl+g",
"command": "editor.action.smartSelect.grow",
"when": "editorTextFocus"
},
{
"key": "ctrl+e ctrl+end",
"command": "editor.action.insertCursorAtEndOfEachLineSelected",
"when": "editorTextFocus"
},
{
"key": "ctrl+e ctrl+space",
"command": "editor.action.indentationToSpaces",
"when": "editorTextFocus"
},
{
"key": "ctrl+e ctrl+tab",
"command": "editor.action.indentationToTabs",
"when": "editorTextFocus"
},
// Section: remove old bindings
{
"key": "ctrl+e",
"command": "-workbench.action.quickOpen"
},
{
"key": "ctrl+e",
"command": "-workbench.action.quickOpenNavigateNext",
"when": "inQuickOpen"
},
{
"key": "ctrl+insert",
"command": "-editor.action.clipboardCopyAction"
},
{
"key": "shift+delete",
"command": "-editor.action.clipboardCutAction"
},
{
"key": "shift+insert",
"command": "-editor.action.clipboardPasteAction"
},
{
"key": "ctrl+/",
"command": "-editor.action.commentLine",
"when": "editorTextFocus"
},
/**
* Group: Window management
* Prefix: ctrl+w
*/
// Section: new bindings
{
"key": "ctrl+w ctrl+\\",
"command": "workbench.action.splitEditor"
},
{
"key": "ctrl+w ctrl+c",
"command": "workbench.action.terminal.openNativeConsole"
},
{
"key": "ctrl+w ctrl+t",
"command": "workbench.action.terminal.toggleTerminal"
},
{
"key": "ctrl+w ctrl+p",
"command": "workbench.action.togglePanel"
},
{
"key": "ctrl+w ctrl+s",
"command": "workbench.action.toggleSidebarVisibility"
},
{
"key": "ctrl+w ctrl+d",
"command": "workbench.view.debug"
},
{
"key": "ctrl+w ctrl+e",
"command": "workbench.view.explorer"
},
{
"key": "ctrl+w ctrl+g",
"command": "workbench.view.git"
},
{
"key": "ctrl+w ctrl+f",
"command": "workbench.view.search"
},
{
"key": "ctrl+w ctrl+=",
"command": "workbench.action.evenEditorWidths"
},
// i.e. maximize current editor
{
"key": "ctrl+w ctrl+-",
"command": "workbench.action.minimizeOtherEditors",
"when": "editorFocus"
},
{
"key": "ctrl+w ctrl+m",
"command": "workbench.action.maximizeEditor",
"when": "editorFocus"
},
{
"key": "ctrl+w ctrl+q",
"command": "workbench.action.closeEditorsInGroup"
},
{
"key": "ctrl+w ctrl+o",
"command": "workbench.action.closeEditorsInOtherGroups",
"when": "editorFocus"
},
{
"key": "ctrl+w ctrl+v",
"command": "workbench.action.markdown.openPreviewSideBySide",
"when": "editorFocus"
},
{
"key": "ctrl+w ctrl+x",
"command": "workbench.view.extensions"
},
// Section: remove old bindings
{
"key": "ctrl+w",
"command": "-workbench.action.closeActiveEditor"
},
/**
* Group: Buffer(file) management
* Prefix: ctrl+b
*/
// Section: new bindings
{
"key": "ctrl+b enter",
"command": "workbench.files.action.addToWorkingFiles"
},
{
"key": "ctrl+b ctrl+q",
"command": "workbench.files.action.closeFile"
},
{
"key": "ctrl+b ctrl+o",
"command": "workbench.files.action.closeOtherFiles"
},
{
"key": "ctrl+b ctrl+w",
"command": "workbench.files.action.focusOpenEditorsView"
},
{
"key": "ctrl+b ctrl+down",
"command": "workbench.files.action.openNextWorkingFile"
},
{
"key": "ctrl+b ctrl+up",
"command": "workbench.files.action.openPreviousWorkingFile"
},
{
"key": "ctrl+b ctrl+z",
"command": "workbench.files.action.reopenClosedFile"
},
{
"key": "ctrl+b ctrl+e",
"command": "workbench.files.action.showActiveFileInExplorer"
},
{
"key": "ctrl+b ctrl+r",
"command": "workbench.action.files.revealActiveFileInWindows"
},
{
"key": "ctrl+b ctrl+p",
"command": "workbench.action.files.copyPathOfActiveFile"
},
// Section: remove old bindings
{
"key": "ctrl+b",
"command": "-workbench.action.toggleSidebarVisibility"
},
/**
* Group: Language
* Prefix: ctrl+l
*/
// Section: new bindings
{
"key": "ctrl+l ctrl+d",
"command": "editor.action.goToDeclaration",
"when": "editorTextFocus"
},
// peek definition
{
"key": "ctrl+l ctrl+p",
"command": "editor.action.previewDeclaration",
"when": "editorTextFocus"
},
{
"key": "ctrl+l ctrl+\\",
"command": "editor.action.openDeclarationToTheSide",
"when": "editorTextFocus"
},
{
"key": "ctrl+l ctrl+r",
"command": "editor.action.findReferences",
"when": "editorTextFocus"
},
/**
* Group: Matching (finding) results
* Prefix: ctrl+m
*/
// Section: new bindings
// select the next match
{
"key": "ctrl+m ctrl+m",
"command": "editor.action.moveSelectionToNextFindMatch",
"when": "editorFocus"
},
// expand current selection and add cursor to the end of it, press
// again to do the same for the next match
{
"key": "ctrl+m ctrl+n",
"command": "editor.action.addSelectionToNextFindMatch",
"when": "editorFocus"
},
// Section: remove old bindings
{
"key": "ctrl+m",
"command": "-editor.action.toggleTabFocusMode",
"when": "editorTextFocus"
},
/**
* Group: Navigation
* Prefix: alt,...
*/
{
"key": "alt+left",
"command": "workbench.action.navigateBack"
},
{
"key": "alt+right",
"command": "workbench.action.navigateForward"
},
{
"key": "ctrl+tab",
"command": "workbench.action.openPreviousEditorFromHistory"
},
{
"key": "ctrl+tab",
"command": "workbench.action.quickOpenNavigateNext",
"when": "inQuickOpen"
}
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment