Skip to content

Instantly share code, notes, and snippets.

@wes-goulet
Last active January 3, 2022 18:05
Show Gist options
  • Save wes-goulet/4dac5a7b7ebcd0e7072c80c5336c5055 to your computer and use it in GitHub Desktop.
Save wes-goulet/4dac5a7b7ebcd0e7072c80c5336c5055 to your computer and use it in GitHub Desktop.
VS Code custom key bindings for MacOS
// Place your key bindings in this file to overwrite the defaults
[
{
"key": "shift+cmd+s",
"command": "workbench.action.files.saveAll"
},
{
"key": "shift+cmd+s",
"command": "-workbench.action.files.saveAs"
},
{
"key": "cmd+b",
"command": "editor.action.goToDeclaration",
"when": "editorHasDefinitionProvider && editorTextFocus && !isInEmbeddedEditor"
},
{
"key": "cmd+n",
"command": "-workbench.action.files.newUntitledFile"
},
{
"key": "cmd+n",
"command": "workbench.action.quickOpen"
},
{
"key": "cmd+ctrl+n",
"command": "workbench.action.files.newUntitledFile"
},
{
"key": "alt+cmd+l",
"command": "editor.action.formatDocument",
"when": "editorTextFocus && !editorReadonly"
}
]
@wes-goulet
Copy link
Author

On MacOS this file goes in:
~/Library/Application Support/Code/User/keybindings.json

@wes-goulet
Copy link
Author

wes-goulet commented Nov 21, 2017

Windows Version:
%appdata%\Code\User\keybindings.json

// Place your key bindings in this file to overwrite the defaults
[
    {
        "key": "ctrl+shift+s",
        "command": "workbench.action.files.saveAll"
    },
    {
        "key": "ctrl+alt+l",
        "command": "editor.action.formatDocument",
        "when": "editorTextFocus && !editorReadonly"
    },
    {
        "key": "ctrl+b",
        "command": "editor.action.goToDeclaration",
        "when": "editorHasDefinitionProvider && editorTextFocus && !isInEmbeddedEditor"
    },
    {
        "key": "ctrl+n",
        "command": "workbench.action.quickOpen"
    },
    {
        "key": "ctrl+n",
        "command": "-workbench.action.files.newUntitledFile"
    }
]

@wes-goulet
Copy link
Author

wes-goulet commented Jan 3, 2022

This is not kept up-to-date any more now that VS code does settings sync

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment