0

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**"
            }
        }]
    },
Jason Song
  • 145
  • 1
  • 9
  • Have you tried it? Your question would be better if you explained what you have tried to make this work. – FvD Apr 14 '22 at 05:53
  • Thanks for your reply. I think I am more like a user than a developer on this though. Also I don't care that much as we can always bind it one by one. – Jason Song Apr 15 '22 at 06:10

0 Answers0