In VS Code, I am aware that you can create files containing global user keybindings and settings, and you can have workspace-specific files for keybindings and settings, but is it possible to define settings or keybindings specific to a language mode?
For instance, I want Alt + / to mean FSI: Send Line
when I'm in F# mode, but not when I'm in markdown mode or JS mode.
And I want my tabs to be 2 spaces when I'm in Elm mode, but 4 spaces in C# mode.
I know you can define keybindings with a when
clause like so:
{
"key": "alt+/",
"command": "fsi.SendLine",
"when": "resourceLangId == fsharp"
}
Is this the only way to achieve something like what I'm after?
It seems like it would make sense to be able to define settings/keybindings for mode X in their own files somewhere. I don't like having language mode behaviour scattered about in big global files like this.