Created
July 14, 2024 18:36
-
-
Save ashleemboyer/5004f1d7a95f3df1b816321f6cf4249d to your computer and use it in GitHub Desktop.
My custom VS Code keybindings
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// These override the defaults | |
// | |
// Accepted keys: | |
// https://code.visualstudio.com/docs/getstarted/keybindings#_accepted-keys | |
// | |
// Run multiple commands: | |
// https://code.visualstudio.com/docs/getstarted/keybindings#_running-multiple-commands | |
// | |
// When clause contexts | |
// https://code.visualstudio.com/api/references/when-clause-contexts#conditional-operators | |
[ | |
// Inserts Markdown inline-code syntax and places the cursor between the backticks (`) | |
{ | |
"key": "cmd+e", | |
"command": "runCommands", | |
"when": "editorLangId == markdown && editorTextFocus && !editorHasSelection", | |
"args": { | |
"commands": [ | |
{ | |
"command": "type", | |
"args": { | |
"text": "``" | |
} | |
}, | |
"cursorLeft" | |
] | |
} | |
}, | |
// Surrounds selected text with backticks (`) in Markdown | |
{ | |
"key": "cmd+e", | |
"when": "editorLangId == markdown && editorHasSelection", | |
"command": "type", | |
"args": { | |
"text": "`" | |
} | |
}, | |
// Inserts a 2x2 Markdown table | |
{ | |
"key": "cmd+t", | |
"command": "type", | |
"when": "editorLangId == markdown && editorTextFocus && !editorHasSelection", | |
"args": { | |
"text": "| Column | Column |\n| ------ | ------ |\n| Cell | Cell |" | |
} | |
}, | |
// Inserts Markdown hyperlink syntax and places the cursor in the link text brackets (`[]`) | |
{ | |
"key": "cmd+k", | |
"command": "runCommands", | |
"when": "editorLangId == markdown && editorTextFocus && !editorHasSelection", | |
"args": { | |
"commands": [ | |
{ | |
"command": "type", | |
"args": { | |
"text": "[]()" | |
} | |
}, | |
"cursorLeft", | |
"cursorLeft", | |
"cursorLeft" | |
] | |
} | |
} | |
] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment