'In VSCode, can we map a same key to different snippet for different languages?
I am just wondering if there's a way to bind the same key to different snippets for different languages in just one keybinding. What I want is something like
{
"key": "cmd+B",
"command": "editor.action.insertSnippet",
"ops": [{
"when": "editorLangId == latex && editorTextFocus",
"args": {
"snippet": "\\textbf{${TM_SELECTED_TEXT}$0}"
}
},
{
"when": "editorLangId == markdown && editorTextFocus",
"args": {
"snippet": "**${TM_SELECTED_TEXT}$0**"
}
}]
},
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
