Skip to content

Instantly share code, notes, and snippets.

@junjuew
Created June 21, 2018 17:01
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 junjuew/8830418c64136c3bbdb54d8f0a0c4b00 to your computer and use it in GitHub Desktop.
Save junjuew/8830418c64136c3bbdb54d8f0a0c4b00 to your computer and use it in GitHub Desktop.
Custom Visual Studio Code Keybinding
// Place your key bindings in this file to overwrite the defaults
// File path on Ubuntu is $HOME/.config/Code/User/keybindings.json
[
// ctrl+shift to navigate among UI elements
{
"key": "ctrl+shift+up",
"command": "-workbench.action.terminal.scrollUp",
"when": "terminalFocus"
},
{
"key": "ctrl+shift+o",
"command": "-workbench.action.gotoSymbol",
},
{
"key": "ctrl+shift+o",
"command": "workbench.action.output.toggleOutput",
},
// ctrl+g chord to do fancy goto operations
{
"key": "ctrl+g",
"command": "-workbench.action.gotoLine",
},
{
"key": "ctrl+g g",
"command": "workbench.action.gotoLine",
},
{
"key": "ctrl+g o",
"command": "workbench.action.gotoSymbol",
},
{
"key": "ctrl+g d",
"command": "C_Cpp.GoToDeclaration",
"when": "editorTextFocus && editorLangId == 'cpp'"
},
{
"key": "ctrl+f12",
"command": "-C_Cpp.GoToDeclaration",
"when": "editorTextFocus && editorLangId == 'cpp'"
},
{
"key": "ctrl+g d",
"command": "C_Cpp.GoToDeclaration",
"when": "editorTextFocus && editorLangId == 'c'"
},
{
"key": "ctrl+f12",
"command": "-C_Cpp.GoToDeclaration",
"when": "editorTextFocus && editorLangId == 'c'"
},
{
"key": "ctrl+g d",
"command": "editor.action.goToDeclaration",
"when": "editorHasDefinitionProvider && editorTextFocus && !isInEmbeddedEditor && editorLangId != 'cpp' && editorLangId !='c'"
},
{
"key": "f12",
"command": "-editor.action.goToDeclaration",
"when": "editorHasDefinitionProvider && editorTextFocus && !isInEmbeddedEditor"
},
{
"key": "n",
"command": "editor.action.diffReview.next",
"when": "isInDiffEditor"
},
{
"key": "f7",
"command": "-editor.action.diffReview.next",
"when": "isInDiffEditor"
},
{
"key": "ctrl+g n",
"command": "editor.action.marker.nextInFiles",
"when": "editorFocus && !editorReadonly"
},
{
"key": "f8",
"command": "-editor.action.marker.nextInFiles",
"when": "editorFocus && !editorReadonly"
},
{
"key": "f7",
"command": "-editor.action.wordHighlight.next",
"when": "editorTextFocus && hasWordHighlights"
},
{
"key": "p",
"command": "editor.action.diffReview.prev",
"when": "isInDiffEditor"
},
{
"key": "shift+f7",
"command": "-editor.action.diffReview.prev",
"when": "isInDiffEditor"
},
{
"key": "ctrl+g p",
"command": "editor.action.marker.prevInFiles",
"when": "editorFocus && !editorReadonly"
},
{
"key": "shift+f8",
"command": "-editor.action.marker.prevInFiles",
"when": "editorFocus && !editorReadonly"
},
{
"key": "shift+f7",
"command": "-editor.action.wordHighlight.prev",
"when": "editorTextFocus && hasWordHighlights"
},
{
"key": "ctrl+g s",
"command": "workbench.action.showAllSymbols"
},
{
"key": "ctrl+t",
"command": "-workbench.action.showAllSymbols"
},
{
"key": "n",
"command": "goToNextReference",
"when": "referenceSearchVisible"
},
{
"key": "f4",
"command": "-goToNextReference",
"when": "referenceSearchVisible"
},
{
"key": "n",
"command": "goToNextReferenceFromEmbeddedEditor",
"when": "inReferenceSearchEditor"
},
{
"key": "f4",
"command": "-goToNextReferenceFromEmbeddedEditor",
"when": "inReferenceSearchEditor"
},
{
"key": "p",
"command": "goToPreviousReference",
"when": "referenceSearchVisible"
},
{
"key": "shift+f4",
"command": "-goToPreviousReference",
"when": "referenceSearchVisible"
},
{
"key": "p",
"command": "goToPreviousReferenceFromEmbeddedEditor",
"when": "inReferenceSearchEditor"
},
{
"key": "shift+f4",
"command": "-goToPreviousReferenceFromEmbeddedEditor",
"when": "inReferenceSearchEditor"
},
{
"key": "ctrl+g t",
"command": "editor.action.goToTypeDefinition"
},
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment