Tuesday, August 23, 2016

Visual Studio Code keyboard shortcuts

These days I’ve been using Visual Studio Code at work. It’s a nifty editor written in NodeJS. Being a Visual C++ user, however, I missed some keyboard shortcuts I like to use. To remedy this, I customized the “keybindings.json” file to make it more familiar. To use it, go File → Preferences → Keyboard Shortcuts.

// Place your key bindings in this file to overwrite the defaults
[
{
"key": "ctrl+shift+numpad_add",
"command": "editor.unfoldAll",
"when": "editorTextFocus && foldingEnabled"
},
{
"key": "ctrl+k ctrl+j",
"command": "-editor.unfoldAll",
"when": "editorTextFocus && foldingEnabled"
},
{
"key": "ctrl+shift+numpad_subtract",
"command": "editor.foldAll",
"when": "editorTextFocus && foldingEnabled"
},
{
"key": "ctrl+k ctrl+0",
"command": "-editor.foldAll",
"when": "editorTextFocus && foldingEnabled"
},
{
"key": "ctrl+numpad_add",
"command": "editor.unfoldRecursively",
"when": "editorTextFocus && foldingEnabled"
},
{
"key": "ctrl+k ctrl+oem_6",
"command": "-editor.unfoldRecursively",
"when": "editorTextFocus && foldingEnabled"
},
{
"key": "ctrl+numpad_subtract",
"command": "editor.foldRecursively",
"when": "editorTextFocus && foldingEnabled"
},
{
"key": "ctrl+k ctrl+oem_4",
"command": "-editor.foldRecursively",
"when": "editorTextFocus && foldingEnabled"
},
{
"key": "alt+c alt+c",
"command": "editor.foldAllBlockComments",
"when": "editorTextFocus && foldingEnabled"
},
{
"key": "ctrl+k ctrl+oem_2",
"command": "-editor.foldAllBlockComments",
"when": "editorTextFocus && foldingEnabled"
},
{
"key": "ctrl+q",
"command": "editor.action.commentLine",
"when": "editorTextFocus && !editorReadonly"
},
{
"key": "ctrl+oem_2",
"command": "-editor.action.commentLine",
"when": "editorTextFocus && !editorReadonly"
},
{
"key": "ctrl+tab",
"command": "workbench.action.nextEditor"
},
{
"key": "ctrl+shift+tab",
"command": "workbench.action.previousEditor"
},
{
"key": "ctrl+shift+f4",
"command": "workbench.action.closeFolder",
"when": "emptyWorkspaceSupport && workbenchState != 'empty'"
},
{
"key": "ctrl+k f",
"command": "-workbench.action.closeFolder",
"when": "emptyWorkspaceSupport && workbenchState != 'empty'"
},
{
"key": "ctrl+shift+s",
"command": "workbench.action.files.saveAll"
},
{
"key": "alt+e",
"command": "errorLens.toggle"
},
{
"key": "alt+h",
"command": "rust-analyzer.toggleInlayHints",
"when": "inRustProject"
},
{
"key": "alt+s",
"command": "editor.action.sortLinesAscending"
},
{
"key": "alt+oem_3",
"command": "workbench.debug.action.toggleRepl",
"when": "workbench.panel.repl.view.active"
},
{
"key": "ctrl+shift+y",
"command": "-workbench.debug.action.toggleRepl",
"when": "workbench.panel.repl.view.active"
},
{
"key": "ctrl+oem_102",
"command": "workbench.action.splitEditor"
},
{
"key": "ctrl+oem_5",
"command": "-workbench.action.splitEditor"
},
{
"key": "ctrl+d",
"command": "workbench.action.toggleSidebarVisibility"
},
{
"key": "ctrl+b",
"command": "-workbench.action.toggleSidebarVisibility"
},
{
"key": "ctrl+numpad_add",
"command": "-workbench.action.zoomIn"
},
{
"key": "ctrl+shift+oem_plus",
"command": "-workbench.action.zoomIn"
},
{
"key": "ctrl+oem_plus",
"command": "-workbench.action.zoomIn"
},
{
"key": "ctrl+numpad_subtract",
"command": "-workbench.action.zoomOut"
},
{
"key": "ctrl+shift+oem_minus",
"command": "-workbench.action.zoomOut"
},
{
"key": "ctrl+oem_minus",
"command": "-workbench.action.zoomOut"
}
]

As a meta side node, this is the first time I use GitHub’s Gist to share code of mine.

No comments: