Skip to content

Instantly share code, notes, and snippets.

@DanielHemmati
Created January 1, 2023 22:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save DanielHemmati/05848c9342b44e8c3f4d18ae9bfb6306 to your computer and use it in GitHub Desktop.
Save DanielHemmati/05848c9342b44e8c3f4d18ae9bfb6306 to your computer and use it in GitHub Desktop.
keyboard shortcut for vscode
// Place your key bindings in this file to override the defaults
[
// {
// "key": "shift+ctrl+=",
// "command": "editor.action.fontZoomIn"
// },
// {
// "key": "ctrl+=",
// "command": "editor.action.fontZoomIn"
// },
{
"key": "ctrl+i",
"command": "workbench.action.terminal.focus"
},
{
"key": "ctrl+i",
"command": "workbench.action.focusActiveEditorGroup",
"when": "terminalFocus"
},
{
"key": "alt+d",
"command": "editor.action.copyLinesDownAction",
"when": "editorTextFocus && !editorReadonly"
},
{
"key": "shift+alt+down",
"command": "-editor.action.copyLinesDownAction",
"when": "editorTextFocus && !editorReadonly"
},
{
"key": "alt+x",
"when": "terminalFocus",
"command": "workbench.action.terminal.kill"
},
{
"key": "ctrl+numpad_add",
"command": "editor.action.fontZoomIn"
},
{
"key": "ctrl+numpad_subtract",
"command": "editor.action.fontZoomOut"
},
{
"key": "shift+ctrl+-",
"command": "editor.action.fontZoomOut"
},
{
"key": "ctrl+-",
"command": "editor.action.fontZoomOut"
},
{
"key": "ctrl+numpad0",
"command": "editor.action.fontZoomReset"
},
{
"key": "ctrl+0",
"command": "editor.action.fontZoomReset"
},
{
"key": "end",
"command": "cursorEnd",
"when": "textInputFocus"
},
{
"key": "end",
"command": "-cursorEnd",
"when": "textInputFocus"
},
// {
// "key": "end",
// "command": "-extension.vim_end",
// "when": "editorTextFocus && vim.active && !inDebugRepl && vim.mode != 'Insert'"
// },
// {
// "key": "escape",
// "command": "extension.vim_escape",
// "when": "editorTextFocus && vim.active && !inDebugRepl"
// },
// {
// "key": "escape",
// "command": "-extension.vim_escape",
// "when": "editorTextFocus && vim.active && !inDebugRepl"
// },
{
"key": "ctrl+1",
"command": "workbench.action.openEditorAtIndex1"
},
{
"key": "ctrl+2",
"command": "workbench.action.openEditorAtIndex2"
},
{
"key": "ctrl+3",
"command": "workbench.action.openEditorAtIndex3"
},
{
"key": "ctrl+4",
"command": "workbench.action.openEditorAtIndex4"
},
{
"key": "ctrl+5",
"command": "workbench.action.openEditorAtIndex5"
},
{
"key": "ctrl+6",
"command": "workbench.action.openEditorAtIndex6"
},
{
// we can delete this
"key": "ctrl+;",
"command": "workbench.action.terminal.clear"
},
{
"key": "ctrl+up",
"command": "workbench.action.terminal.scrollToPreviousCommand",
"when": "terminalFocus"
},
{
"key": "ctrl+down",
"command": "workbench.action.terminal.scrollToNextCommand",
"when": "terminalFocus"
},
{
"key": "ctrl+shift+up",
"command": "workbench.action.terminal.selectToPreviousCommand",
"when": "terminalFocus"
},
{
"key": "ctrl+shift+down",
"command": "workbench.action.terminal.selectToNextCommand",
"when": "terminalFocus"
},
{
// trigger suggestion
"key": "shift+space",
"command": "editor.action.triggerSuggest",
"when": "editorHasCompletionItemProvider && textInputFocus && !editorReadonly"
},
{
"key": "ctrl+space",
"command": "-editor.action.triggerSuggest",
"when": "editorHasCompletionItemProvider && textInputFocus && !editorReadonly"
},
{
"key": "ctrl+9",
"command": "python.execInTerminal"
},
{
"key": "ctrl+9",
"command": "-workbench.action.lastEditorInGroup"
},
// vim navigation next level changed 30.9.2020
{
"key": "ctrl+j",
"command": "workbench.action.focusBelowGroup"
},
// {
// "key": "ctrl+w j",
// "command": "workbench.action.focusBelowGroup"
// },
{
"key": "ctrl+k",
"command": "workbench.action.focusAboveGroup"
},
{
"key": "ctrl+h",
"command": "workbench.action.focusLeftGroup"
},
{
"key": "ctrl+l",
"command": "workbench.action.focusRightGroup"
},
// this 4 is helpful when you want to change the place of groups
{
"key": "ctrl+b down",
"command": "workbench.action.moveActiveEditorGroupDown"
},
{
"key": "ctrl+b up",
"command": "workbench.action.moveActiveEditorGroupUp"
},
{
"key": "ctrl+b left",
"command": "workbench.action.moveActiveEditorGroupLeft"
},
{
"key": "ctrl+b right",
"command": "workbench.action.moveActiveEditorGroupRight"
},
// all of this four is for when you wantto come out of the
// insert mode, i mean i like it, let's see how it goes
// change this for windows
{
// 15.10.2020 added
"key": "alt+j",
"command": "extension.vim_escape",
"when": "editorTextFocus && vim.active && vim.mode == 'Insert'"
},
// {
// "key": "alt+j",
// "command": "extension.vim_escape",
// "when": "editorTextFocus && vim.active && vim.mode == 'Insert'"
// },
// {
// "key": "alt+k",
// "command": "extension.vim_escape",
// "when": "editorTextFocus && vim.active && vim.mode == 'Insert'"
// },
// {
// "key": "alt+l",
// "command": "extension.vim_escape",
// "when": "editorTextFocus && vim.active && vim.mode == 'Insert'"
// },
{
// "key": "ctrl+shift+tab",
"key": "alt+i",
"command": "workbench.action.focusNextGroup"
},
{
"key": "alt+i",
"command": "workbench.action.previousEditorInGroup"
},
{
"key": "alt+o",
"command": "workbench.action.nextEditorInGroup"
},
// minimize other editor
{
"key": "ctrl+b shift+-",
"command": "workbench.action.minimizeOtherEditors"
},
{
"key": "ctrl+b =",
"command": "workbench.action.evenEditorWidths"
},
{
"key": "ctrl+b v",
"command": "workbench.action.splitEditorRight"
},
{
"key": "ctrl+b s",
"command": "workbench.action.splitEditorDown"
},
// {
// "key": "ctrl+b c",
// "command": "workbench.action.closeActiveEditor"
// },
{
// IDK :| that's all i got for now
"key": "alt+q",
// because i want to reverse search command line history
"when": "editorFocus",
"command": "workbench.action.closeActiveEditor"
},
// splittin window
{
"key": "ctrl+b shift+k",
"command": "workbench.action.moveEditorToAboveGroup"
},
{
"key": "ctrl+b shift+j",
"command": "workbench.action.moveEditorToBelowGroup"
},
{
"key": "ctrl+b shift+h",
"command": "workbench.action.moveEditorToLeftGroup"
},
{
"key": "ctrl+b shift+l",
"command": "workbench.action.moveEditorToRightGroup"
},
// idk how does it work
{
"key": "ctrl+b",
"command": "-extension.vim_ctrl+b",
"when": "editorTextFocus && vim.active && vim.use<C-b> && !inDebugRepl && vim.mode != 'Insert'"
},
{
"key": "ctrl+k",
"command": "-extension.vim_ctrl+k",
"when": "editorTextFocus && vim.active && vim.use<C-k> && !inDebugRepl"
},
{
"key": "ctrl+b b",
"command": "workbench.action.toggleSidebarVisibility"
},
// {
// "key": "ctrl+b",
// "command": "-workbench.action.toggleSidebarVisibility"
// },
{
"key": "ctrl+b a",
"command": "workbench.action.toggleActivityBarVisibility"
},
{
"key": "ctrl+alt+p",
"command": "workbench.files.action.showActiveFileInExplorer"
},
{
"key": "ctrl+b n",
"command": "workbench.action.nextSideBarView"
},
{
"key": "ctrl+b p",
"command": "workbench.action.previousSideBarView"
},
{
"key": "ctrl+b m",
"command": "workbench.action.toggleMenuBar"
},
{
"key": "ctrl+b s",
"command": "workbench.action.toggleStatusbarVisibility"
},
{
"key": "ctrl+b l",
"command": "workbench.action.toggleSidebarPosition"
},
{
"key": "ctrl+b o",
"command": "outline.focus"
},
{
// "key": "ctrl+b e", focus on file explorer
"key": "ctrl+alt+o",
"command": "workbench.files.action.focusFilesExplorer"
},
// focus is not enough we should focus on the input
// but for now is awesome
{
// {
// "key": "ctrl+w =",
// "command": "workbench.action.evenEditorWidths"
// }
"key": "ctrl+b r",
"command": "search.action.focusSearchList"
},
// {
// "key": "ctrl+' l",
// "command": "workbench.action.togglePanelPosition"
// print()},
{
"key": "ctrl+' '",
"command": "workbench.action.togglePanel"
},
{
"key": "ctrl+' c",
"command": "workbench.debug.panel.action.clearReplAction",
"when": "inDebugRepl"
},
{
"key": "meta+l",
"command": "-workbench.debug.panel.action.clearReplAction",
"when": "inDebugRepl"
},
{
"key": "ctrl+' n",
"command": "workbench.action.nextPanelView"
},
{
"key": "ctrl+' p",
"command": "workbench.action.previousPanelView"
},
// maximize terminal
{
"key": "alt+shift+=",
"command": "workbench.action.toggleMaximizedPanel"
},
{
// delete the word left (it works well with pytho)
// var naming
"key": "alt+u",
"command": "deleteWordPartLeft"
},
// terminal place yo know? #where_should my terminal be
{
"key": "ctrl+' r",
"command": "workbench.action.positionPanelRight"
},
{
"key": "ctrl+' b",
"command": "workbench.action.positionPanelBottom"
},
{
"key": "ctrl+' l",
"command": "workbench.action.positionPanelLeft"
},
// i added in 26/2/2020, this is for when you are in and you want
// to go to the next different shell, for me for example is powershell
{
"key": "ctrl+shift+j",
"command": "workbench.action.terminal.focusNext"
},
{
"key": "ctrl+shift+k",
"command": "workbench.action.terminal.focusPrevious"
},
{
"key": "alt+n",
"command": "extension.openInDefaultBrowser"
},
{
// i change it to e because, i want to use ctrl+d for indentaion in insert mode
"key": "ctrl+q f12",
"command": "editor.action.revealDefinitionAside",
"when": "editorHasDefinitionProvider && editorTextFocus && !isInEmbeddedEditor"
},
// {
// "key": "ctrl+u",
// "command": "workbench.action.terminal.deleteWordLeft",
// "when": "terminalFocus"
// },
{
"key": "ctrl+k f12",
"command": "-editor.action.revealDefinitionAside",
"when": "editorHasDefinitionProvider && editorTextFocus && !isInEmbeddedEditor"
},
// this is funny, because it can also cycle in the terminal
// i keep it here until there is a better solution for it
{
"key": "alt+n",
"command": "workbench.action.terminal.focusPreviousPane",
"when": "terminalFocus"
},
{
"key": "alt+left",
"command": "-workbench.action.terminal.focusPreviousPane",
"when": "terminalFocus"
},
{
"key": "ctrl+e",
"command": "-workbench.action.quickOpen"
},
{
"key": "alt+shift+[",
"command": "editor.emmet.action.matchTag",
"when": "editorTextFocus && editorLangId == 'html'"
},
{
"key": "ctrl+h",
"command": "-editor.action.startFindReplaceAction"
},
// ctrl+h is for fuzzy file finder, because i want to use ctrl+p for terminla
{
"key": "ctrl+o",
"command": "workbench.action.quickOpen"
// "when": "editorTextFocus && terminalFocus"
},
{
"key": "ctrl+[",
"command": "-extension.vim_ctrl+[",
"when": "editorTextFocus && vim.active && vim.use<C-[> && !inDebugRepl"
},
{
"key": "ctrl+n",
"command": "-workbench.action.files.newUntitledFile"
},
{
// going to last cursor location, lucky that i find this
"key": "alt+m",
"command": "extension.vim_ctrl+o"
},
{
// this will only work when we are in the markdown env
"key": "ctrl+m",
"command": "markdown.extension.editing.toggleMath",
"when": "editorTextFocus && !editorReadonly && editorLangId == 'markdown'"
},
{
"key": "ctrl+n",
"command": "-extension.vim_ctrl+n",
"when": "editorTextFocus && vim.active && vim.use<C-n> && !inDebugRepl || vim.active && vim.use<C-n> && !inDebugRepl && vim.mode == 'CommandlineInProgress' || vim.active && vim.use<C-n> && !inDebugRepl && vim.mode == 'SearchInProgressMode'"
},
{
"key": "ctrl+n",
"command": "extension.vim_ctrl+n"
},
{
// the first default one
"key": "alt+shift+e",
"command": "workbench.view.explorer"
},
{
// it's an extension
// matching html extension
"key": "shift+alt+[",
"command": "highlight-matching-tag.jumpToMatchingTag"
},
{
// if you are in the terminal you can not use ctrl+p
// which is exactly what it want
"key": "ctrl+p",
"command": "-workbench.action.quickOpen"
},
{
"key": "ctrl+b g",
"command": "gistpad.gists.focus"
},
{
"key": "ctrl+shift+i",
"command": "-emojisense.quickEmojitext",
"when": "editorTextFocus"
},
{
"key": "ctrl+shift+v",
"command": "-markdown.showPreview",
"when": "!notebookEditorFocused && editorLangId == 'markdown'"
},
{
"key": "ctrl+shift+v",
"command": "-markdown.extension.togglePreview",
"when": "!terminalFocus"
},
{
"key": "alt+e e",
"command": "clipboard-manager.editor.pickAndPaste",
"when": "textInputFocus && !editorReadonly"
},
{
"key": "alt+e c",
"command": "clipboard-manager.history.clear"
},
{
"key": "ctrl+shift+v",
"command": "-clipboard-manager.editor.pickAndPaste",
"when": "textInputFocus && !editorReadonly"
},
{
"key": "ctrl+b c",
"command": "clipboardHistory.focus"
},
{
// we do this with vim
"key": "ctrl+alt+k",
"command": "-bookmarks.toggle",
"when": "editorTextFocus"
},
{
// make new file
"key": "ctrl+alt+n",
"command": "explorer.newFile"
},
{
// make new folder
"key": "ctrl+alt+m",
"command": "explorer.newFolder"
},
{
"key": "ctrl+t ,",
"command": "workbench.action.terminal.rename"
},
{
"key": "ctrl+t t",
"command": "workbench.action.terminal.split",
"when": "terminalFocus && terminalProcessSupported"
},
/* -------------------------- reseize the termianl -------------------------- */
{
// change the size of the terminal
"key": "ctrl+shift+right",
"command": "workbench.action.terminal.resizePaneRight",
"when": "terminalFocus && terminalProcessSupported"
},
{
// change the size of the terminal
"key": "ctrl+shift+up",
"command": "workbench.action.terminal.resizePaneUp",
"when": "terminalFocus && terminalProcessSupported"
},
{
// change the size of the terminal
"key": "ctrl+shift+down",
"command": "workbench.action.terminal.resizePaneDown",
"when": "terminalFocus && terminalProcessSupported"
},
{
"key": "alt+f",
"command": "editor.action.formatDocument",
"when": "editorHasDocumentFormattingProvider && editorTextFocus && !editorReadonly && !inCompositeEditor"
},
{
"key": "shift+alt+f",
"command": "-editor.action.formatDocument",
"when": "editorHasDocumentFormattingProvider && editorTextFocus && !editorReadonly && !inCompositeEditor"
},
{
"key": "alt+h",
"command": "code-runner.run"
},
{
"key": "ctrl+alt+n",
"command": "-code-runner.run"
},
{
"key": "",
"command": "workbench.action.files.openFolder",
"when": "openFolderWorkspaceSupport"
},
{
// i don't even use this
"key": "ctrl+shift+left",
"command": "-cursorWordLeftSelect",
"when": "textInputFocus && !accessibilityModeEnabled"
},
{
"key": "ctrl+shift+left",
"command": "workbench.action.terminal.resizePaneLeft"
},
{
"key": "shift+alt+r",
"command": "revealFileInOS",
"when": "!editorFocus"
},
{
"key": "shift+alt+r",
"command": "-revealFileInOS",
"when": "!editorFocus"
},
{
// i kept pressing this keybinding and it went into my nerves
"key": "ctrl+shift+w",
"command": "-workbench.action.closeWindow"
},
{
"key": "ctrl+alt+r",
"command": "workbench.action.openRecent"
},
{
"key": "ctrl+r",
"command": "-workbench.action.openRecent"
},
{
// also jupyter have this keyboard shortcut, but we use vim. so not worries
"key": "ctrl+alt+]",
"command": "workbench.action.closeEditorsToTheRight"
},
{
// it only works when you are focusing on the terminal
"key": "ctrl+k",
"command": "workbench.action.terminal.focusPrevious",
"when": "terminalFocus && terminalHasBeenCreated && !terminalEditorFocus || terminalFocus && terminalProcessSupported && !terminalEditorFocus"
},
{
// it only works when you are focusing on the terminal
"key": "ctrl+j",
"command": "workbench.action.terminal.focusNext",
"when": "terminalFocus && terminalHasBeenCreated && !terminalEditorFocus || terminalFocus && terminalProcessSupported && !terminalEditorFocus"
},
{
"key": "ctrl+m",
"command": "-editor.action.toggleTabFocusMode"
},
{
"key": "ctrl+z",
"command": "undo",
"when": "notebookEditorFocused && !inputFocus"
},
{
// instead i put it on the ctrl+z b/c i use z in vim for page centerin
"key": "z",
"command": "-undo",
"when": "notebookEditorFocused && !inputFocus"
},
{
"key": "ctrl+alt+i",
"command": "-emojisense.quickEmojiTerminal",
"when": "terminalFocus"
},
{
"key": "ctrl+alt+;",
"command": "notebook.centerActiveCell",
"when": "notebookEditorFocused"
},
{
"key": "ctrl+l",
"command": "-notebook.centerActiveCell",
"when": "notebookEditorFocused"
}
// {
// "key": "cmd+f", // "ctrl+f" on Windows/Linux
// "command": "-list.find",
// "when": "listFocus && listSupportsFind"
// }
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment