Skip to content

Instantly share code, notes, and snippets.

@CharlesHolbrow
Last active July 27, 2020 03:35
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save CharlesHolbrow/f3c4da73941f787a40d4246e75dd24c8 to your computer and use it in GitHub Desktop.
// Place your key bindings in this file to override the defaults
[
{
"key": "alt+f",
"command": "settings.action.search",
"when": "inSettingsEditor"
},
{
"key": "ctrl+f",
"command": "-settings.action.search",
"when": "inSettingsEditor"
},
{
"key": "alt+b",
"command": "workbench.action.toggleSidebarVisibility"
},
{
"key": "ctrl+b",
"command": "-workbench.action.toggleSidebarVisibility"
},
{
"key": "ctrl+b",
"command": "cursorLeft",
"when": "textInputFocus"
},
{
"key": "alt+f",
"command": "actions.find"
},
{
"key": "ctrl+f",
"command": "-actions.find"
},
{
"key": "alt+f",
"command": "workbench.action.terminal.focusFind",
"when": "terminalFindFocused || terminalFocus"
},
{
"key": "ctrl+f",
"command": "-workbench.action.terminal.focusFind",
"when": "terminalFindFocused || terminalFocus"
},
{
"key": "alt+f",
"command": "keybindings.editor.searchKeybindings",
"when": "inKeybindings"
},
{
"key": "ctrl+f",
"command": "-keybindings.editor.searchKeybindings",
"when": "inKeybindings"
},
{
"key": "alt+f",
"command": "notebook.find",
"when": "notebookEditorFocused"
},
{
"key": "ctrl+f",
"command": "-notebook.find",
"when": "notebookEditorFocused"
},
{
"key": "alt+f",
"command": "repl.action.filter",
"when": "inDebugRepl && textInputFocus"
},
{
"key": "ctrl+f",
"command": "-repl.action.filter",
"when": "inDebugRepl && textInputFocus"
},
{
"key": "ctrl+a",
"command": "-editor.action.selectAll"
},
{
"key": "alt+a",
"command": "list.selectAll",
"when": "listFocus && listSupportsMultiselect && !inputFocus"
},
{
"key": "ctrl+a",
"command": "-list.selectAll",
"when": "listFocus && listSupportsMultiselect && !inputFocus"
},
{
"key": "alt+a",
"command": "editor.action.webvieweditor.selectAll",
"when": "!editorFocus && !inputFocus && activeEditor == 'WebviewEditor'"
},
{
"key": "ctrl+a",
"command": "-editor.action.webvieweditor.selectAll",
"when": "!editorFocus && !inputFocus && activeEditor == 'WebviewEditor'"
},
{
"key": "ctrl+a",
"command": "cursorHome",
"when": "textInputFocus"
},
{
"key": "ctrl+e",
"command": "cursorEnd",
"when": "textInputFocus"
},
{
"key": "ctrl+p",
"command": "-workbench.action.quickOpen"
},
{
"key": "ctrl+p",
"command": "cursorUp",
"when": "textInputFocus"
},
{
"key": "alt+n",
"command": "workbench.action.files.newUntitledFile"
},
{
"key": "ctrl+n",
"command": "-workbench.action.files.newUntitledFile"
},
{
"key": "ctrl+n",
"command": "cursorDown",
"when": "textInputFocus"
},
{
"key": "ctrl+n",
"command": "list.focusDown",
"when": "listFocus && !inputFocus"
},
{
"key": "ctrl+n",
"command": "history.showNext",
"when": "historyNavigationEnabled && historyNavigationWidget"
},
{
"key": "ctrl+p",
"command": "list.focusUp",
"when": "listFocus && !inputFocus"
},
{
"key": "ctrl+p",
"command": "history.showPrevious",
"when": "historyNavigationEnabled && historyNavigationWidget"
},
{
"key": "meta+b",
"command": "cursorWordStartLeft",
"when": "textInputFocus"
},
{
"key": "meta+f",
"command": "cursorWordEndRight",
"when": "textInputFocus"
},
{
"key": "ctrl+f",
"command": "cursorRight",
"when": "textInputFocus"
},
// Cut, Copy, Paste, Undo, Redo: Make them feel like a Mac
{
"key": "alt+x",
"command": "editor.action.clipboardCutAction",
},
{
"key": "alt+v",
"command": "editor.action.clipboardPasteAction",
},
{
"key": "alt+c",
"command": "editor.action.clipboardCopyAction",
},
{
"key": "alt+z",
"command": "undo",
},
{
"key": "shift+alt+z",
"command": "redo",
},
{
"key": "alt+z",
"command": "notebook.undo",
"when": "notebookEditorFocused && !inputFocus"
},
{
"key": "shift+alt+z",
"command": "notebook.redo",
"when": "notebookEditorFocused && !inputFocus"
},
// Make "save" feel like a Mac
{
"key": "alt+s",
"command": "workbench.action.files.save"
},
{
"key": "shift+alt+s",
"command": "workbench.action.files.saveFiles"
},
// Make command palette and "Go To File" feel like a Mac
// This is necessary because "ctrl+p" is used for "cursorUp"
{
"key": "alt+p",
"command": "workbench.action.quickOpen"
},
{
"key": "alt+p",
"command": "workbench.action.quickOpenNavigateNextInFilePicker",
"when": "inFilesPicker && inQuickOpen"
},
{
"key": "ctrl+p",
"command": "-workbench.action.quickOpenNavigateNextInFilePicker",
"when": "inFilesPicker && inQuickOpen"
},
{
"key": "alt+p",
"command": "-keybindings.editor.toggleSortByPrecedence",
"when": "inKeybindings"
},
{
"key": "shift+alt+p",
"command": "workbench.action.showCommands"
},
{
"key": "alt+a",
"command": "editor.action.selectAll"
},
// Command Palette navigate up and down
{
"key": "ctrl+n",
"command": "workbench.action.quickOpenSelectNext",
"when": "inQuickOpen"
},
{
"key": "ctrl+p",
"command": "workbench.action.quickOpenSelectPrevious",
"when": "inQuickOpen"
},
// Command+W Make closing tabs on windows and linux feel more like Mac
{
"key": "alt+w",
"command": "workbench.action.closeActiveEditor",
"when": "!isMac"
},
{
"key": "alt+w",
"command": "workbench.action.closeWindow",
"when": "!editorIsOpen && !multipleEditorGroups && !isMac"
},
{
"key": "alt+w",
"command": "workbench.action.closeGroup",
"when": "activeEditorGroupEmpty && multipleEditorGroups && !isMac"
}
]
// Place your key bindings in this file to overwrite the defaults
[
{
"key": "win+s",
"command": "workbench.action.files.save"
},
{
"key": "alt+s",
"command": "workbench.action.files.save"
},
// move cursor line start and end
{
"key": "ctrl+a",
"command": "cursorHome",
},
{
"key": "ctrl+e",
"command": "cursorEnd",
"when": "textInputFocus",
},
// move cursor one step
{
"key": "ctrl+f",
"command": "-actions.find"
},
{
"key": "ctrl+f",
"command": "cursorRight",
"when": "inputFocus"
},
{
"key": "ctrl+b",
"command": "cursorLeft",
"when": "inputFocus"
},
{
"key": "ctrl+p",
"command": "cursorUp"
},
{
"key": "ctrl+n",
"command": "cursorDown"
},
// move by one word
{
"key": "alt+f",
"command": "cursorWordRight",
"when": "inputFocus"
},
{
"key": "alt+b",
"command": "cursorWordLeft",
"when": "inputFocus"
},
{
"key": "win+b",
"command": "cursorWordLeft",
"when": "inputFocus"
},
// find/search
{
"key": "ctrl+s",
"command": "-workbench.action.files.save"
},
{
"key": "ctrl+s",
"command": "actions.find",
"when": "inputFocus"
},
// cut copy paste undo all mapped to "alt" in addition to "ctrl"
{
"key": "alt+x",
"command": "editor.action.clipboardCutAction",
"when": "textInputFocus && !editorReadonly"
},
{
"key": "alt+c",
"command": "editor.action.clipboardCopyAction",
"when": "textInputFocus && !editorReadonly"
},
{
"key": "alt+v",
"command": "editor.action.clipboardPasteAction",
"when": "textInputFocus"
},
{
"key": "alt+z",
"command": "undo",
"when": "textInputFocus && !editorReadonly"
},
// Delete
{
"key": "alt+backspace",
"command": "deleteWordLeft",
"when": "textInputFocus && !editorReadonly"
},
{
"key": "ctrl+d",
"command": "deleteRight",
"when": "textInputFocus && !editorReadonly"
},
{
"key": "ctrl+k",
"command": "deleteAllRight",
"when": "editorTextFocus"
},
// Selection
{
"key": "alt+a",
"command": "editor.action.selectAll"
},
{
"key": "shift+alt+right",
"command": "cursorEndSelect",
"when": "textInputFocus"
},
{
"key": "shift+end",
"command": "-cursorEndSelect",
"when": "textInputFocus"
},
{
"key": "shift+alt+left",
"command": "cursorHomeSelect",
"when": "textInputFocus"
},
{
"key": "shift+home",
"command": "-cursorHomeSelect",
"when": "textInputFocus"
},
{
"key": "alt+d",
"command": "editor.action.addSelectionToNextFindMatch",
"when": "editorFocus"
},
{
"key": "ctrl+d",
"command": "-editor.action.addSelectionToNextFindMatch",
"when": "editorFocus"
},
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment