Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to make language specific keybinding in vscode

I want to make a keybinding in vscode, but want it to only work in markdown. I think I should use when clause, but not sure how to set the parameter for this clause.

like image 993
Neo Avatar asked Oct 31 '25 17:10

Neo


1 Answers

Yes, you need to use the editorLangId parameter in the when condition key.
You should do something like this:

{
"key": "key1+key2+key3",
"command": "some.editor.action",
"when": "editorLangId == 'markdown' && withThisCondition || otherwiseSomethingElse"
}
like image 151
HA3IK Avatar answered Nov 02 '25 07:11

HA3IK



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!