Skip to content

Instantly share code, notes, and snippets.

@colinhacks
Created January 16, 2022 23:50
Show Gist options
  • Star 10 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save colinhacks/be04d453a0552b2c11615096651087ee to your computer and use it in GitHub Desktop.
Save colinhacks/be04d453a0552b2c11615096651087ee to your computer and use it in GitHub Desktop.
VSCode shortcuts for console.log and JSON.stringify
// keybindings.json
// Command Pallette > Open Keyboard Shortcuts (JSON)
[
{
"key": "cmd+shift+l",
"command": "editor.action.insertSnippet",
"when": "editorTextFocus",
"args": {
"snippet": "console.log(${TM_SELECTED_TEXT}$1)$0;"
}
},
{
"key": "cmd+shift+j",
"command": "editor.action.insertSnippet",
"when": "editorTextFocus",
"args": {
"snippet": "JSON.stringify(${TM_SELECTED_TEXT}$1, null, 2)$0"
}
}
// ...
]
@o-az
Copy link

o-az commented Jan 22, 2022

love it. Thank you!

@nickkaradzha
Copy link

legend!

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