-
Notifications
You must be signed in to change notification settings - Fork 32.8k
Add a a general Toggle and Cycle commands for keybinding #166631
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I do not think this can be a core feature as it is a sugar coating on top which can be done by extensions. |
@sandy081 Both extensions that effectively fulfill the Those extensions were developed by Microsoft members, so it should be good. As I explained, those commands being built-in would solves problems for end users by providing a way to personalize keys binding and help a lot other extensions, I gave examples. I see those commands (which in reality is only one command and one special case where N=2) as core. |
CC @isidorn |
This issue should still be open. I ended up in this thread because I couldn't find toggle keybindings for Rust Analyzer in VSCode settings. The ability to toggle settings with keybindings is such an obvious feature I'm rather surprised that VSCode can't do this out of the millions of things it can. Assignable keybindings and an activity bar settings toggle feature would do the trick. |
@sandy081 |
Strong disagree. Basic features like this should not be reliant on an external extension. Having a lot of small extensions doing very basic stuff (or worse different extensions doing similar, but not the same stuff) doesn't lead to an integral ergonomic 'VSCode' way of doing things. IMO this harms usability and in the end the VSCode product. To illustrate why this is a bad idea: |
Hi,
Toggling configs is usefull, and having a general solution is great for users and for extension developpers as well.
The feature is just a
cycle
command that get in the "args" property an array of n settings objects.The settings objects have to have the same schema, and activating the
cycle
command apply the the settings defined in the next object of the array until it reach the last member and cycle back to the first member.The second feature is just a
toggle
command the is exactly the same thancycle
, just the special case of an array of 2 settings objects excatly (and will complain if it's not exactly 2 members). It's just syntax sugar.It would looks like this:
The reason for the unique id is to make the implementation easier, even if it could be generated, the advantage of letting the user set it, it that it can be used as a the name of the command to be display in the Command Palette: Toggle <"id"> and Cycle <"id">.
So with the current example, we would have "Toggle Zen" and "Cycle Theme and Font" in the Command Palette.
After reading the article Toggle any setting in VS Code using keyboard shortcut arguments by @rebornix and looking at his extension Toggle (marketplace, repo) I find it very usefull to have a
toggle
command for keybinding.(I use it to toggle
editor.inlayHints.enabled
betweenon
andoff
with the keybinding I like, which effectively solve #163201, #149019 and #154962)One issue with the Toggle extension is that it appears closed source on the marketplace because the url to the repo is missing from the package.json file. Beside that it seems simple and super effective.
There is also another extension mentioned in the article called Settings Cycler (marketplace, repo) from @hoovercj. I didn't try it but it seems more general than Toggle by taking into account the user settings and workspace settings and detecting workspace settings collisions.
It seems like a neat feature for vscode and would be great if it's built in.
Have a nice day.
The text was updated successfully, but these errors were encountered: