Keybindings: provide some guidance on when-clause support
See original GitHub issueI find when
clauses are one of the most powerful features in VSCode keybinding story, but we have only very limited support for understanding it from the product itself.
We very likely have duplicates already for supporting intellisense etc. for contexts, but at the very minimum can we at least somehow link to https://code.visualstudio.com/docs/getstarted/keybindings#_when-clause-contexts from the keybindings editor?
Maybe with some link in the table and maybe with an extra menu item close to the entry for “Change when expression”?
//cc @misolori @alexandrudima
Issue Analytics
- State:
- Created 4 years ago
- Reactions:8
- Comments:5 (2 by maintainers)
Top Results From Across the Web
when clause contexts | Visual Studio Code Extension API
when clause contexts. Visual Studio Code sets various context keys and specific values depending on what elements are visible and active in the...
Read more >Keybindings: Is there a `when` clause for the index of ...
Here's my current bindings: { "key": "ctrl+.", "command": "workbench.action.nextEditorInGroup", "when ...
Read more >VS Code keyboard-fu: custom keyboard shortcuts that will ...
Keyboard shortcuts can help you achieve tasks quicker, and with less ... This is not intended to be a guide on keybindings in...
Read more >Key Bindings for Visual Studio Code - vscode-docs1
Visual Studio Code provides a rich and easy keyboard shortcuts editing ... To help with this, File > Preferences > Keymap Extensions shows...
Read more >Key Bindings - Onivim 2 User Manual
There are a set of default rules provided by Onivim, but the customized rules ... The key parameter supports both Vim style and...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
An example of my confusion: the new when-clause
"when": "focusedView == nodeDependencies"
(which hasn’t made it to https://code.visualstudio.com/docs/getstarted/keybindings#_when-clause-contexts yet). Are the only possibleviews
those identified in that link?workbench.view.explorer - File Explorer workbench.view.search - Search workbench.view.scm - Source Control workbench.view.debug - Debug workbench.view.extensions - Extensions
and nothing more? Except presumably extension-contributed views like
nodeDependencies
.What is the
outline
in the explorer? It doesn’t seem to be aview
or at least I couldn’t get it to work withfocusedView
. And what is the difference between aview
and aviewlet
?I also struggled with figuring out what conditions are available and what are their values in every context. I ended up debugging VSCode and storing the values which solved the issues I had, see here for details and a long list of available variables in when clauses for a few contexts: https://github.com/infokiller/config-public/tree/master/.config/Code/User/reference