Skip to content

Instantly share code, notes, and snippets.

@lipkau
Created May 19, 2017 15:21
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 lipkau/25194fb72d732864997a78ec4e82b042 to your computer and use it in GitHub Desktop.
Save lipkau/25194fb72d732864997a78ec4e82b042 to your computer and use it in GitHub Desktop.
Insert Snippet around selection with keybinding #vscode #sample
{
"make_strong": {
"prefix": "strong",
"body": [
"<strong>$TM_SELECTED_TEXT${1}</strong>${0}"
],
"description": "Encloses selected text in <strong></strong> tags"
},
"make_italic": {
"prefix": "italic",
"body": [
"<em>$TM_SELECTED_TEXT${1}</em>${0}"
],
"description": "Encloses selected text in <em></em> tags"
}
}
[
{
"key": "ctrl+i",
"command": "editor.action.insertSnippet",
"args": { "name": "make_italic" },
"when": "editorHasSelection && editorLangId == html"
},
{
"key": "ctrl+b",
"command": "editor.action.insertSnippet",
"args": { "name": "make_strong" },
"when": "editorHasSelection && editorLangId == html"
}
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment