Open JoyalToTheWorld opened 7 years ago
seems like a duplicate of https://github.com/Microsoft/vscode/issues/4504 where an extension was suggested instead
I found thru https://stackoverflow.com/questions/48945319/a-keybindings-json-per-workspace-in-visual-studio-code
also:
I believe this issue attempts to address part of the reasoning used to dismiss issue #4504: this issue requests an alert noting when local keyboard shortcuts would be overwritten by workspace-specific shortcuts. As to the "win+" vs "cmd+" argument, these keys should simply be synonymous for obvious reasons.
I would also like to see this feature, not simply for team sharing (as noted in the other issue), but also so I can easily move from one computer to another, sharing the Workspace via a cloud, and have the same shortcuts easily available.
Finally, users can build shortcuts that are primarily designed for a given project/workspace. This feature would allow a clear distinction between general, user-defined shortcuts and workspace-specific shortcuts while alerting a user when his or her settings are being overwritten (and perhaps allow the user to prevent this?).
Thanks for your time and effort!
Another strong argument in favor of this feature is tasks. If I can't define tasks globally, why force me to assign keyboard shortcuts to them in exactly such way.
Consider a task called "Foo" and the following keybindings.json content:
{
"key": "ctrl+h",
"command": "workbench.action.tasks.runTask",
"args": "Foo"
}
The same combination of keys can now trigger entrirely different behavior across several workspaces.
@davidstraka2 Yes in multiple workspaces my keys trigger different tasks! Drives me crazy... There should be consistency between the different config files.
This feature would be appreciated because adding some key bindings (or disabling them cough https://github.com/Microsoft/vscode/issues/60711) are very helpful to share across team members / desktops / laptops in the same way we standardize other settings. Creating a custom extension is a doable workaround but adds significant overhead, compared with the way other workspace settings can be defined.
For me, it is about the Run Tests task. You have Cmd+Shift+B for the Build task. It appears that you removed the Cmd+Shift+T keystroke for the Run Tests tasks. I want to ensure that those two keystrokes are consistant within my organization. Honestly, I should be able to define the keystroke when I define the task but, failing that, have a way to "bake" it into the project. i.e. Allow me to add a keybindings.json file in the .vscode directory or let me add the keybindings json snippet to the settings.json file (or some other mechanism). I just need an easy/consistant way to run our Test task.
...probably allow us to specify key bindings right in tasks.json?
Imagine grabbing a third party codebase and then unwittingly running their shortcut to a binary as you copy a line out of the editor.
Sad times - and maybe a security solution should be considered?
@chrisbward this could probably hook nicely into the new-ish Workspace Trust feature. Workspace tasks are already disabled in "restricted mode." It would probably make sense to disable keyboard shortcuts as well.
I would like to see local workspace keybindings.json for two reasons:
I have different projects that use the same keybinding to run the same command "evalInHost" but with different arguments for each workspace (the host app specifier is different depending on the project/workspace).
Adding a keybindings.json file to the local .vscode workspace folder is logical and expected—I did it intuitively (before discovering it doesn't work).
Am I missing the "correct" way of achieving what I need? I have read other (closed) issues asking for the same thing (for different use cases) and none of the reasons given against the feature persuade me. Sure it would be bad manners to add personal keybindings to a shared project—no argument there—and I would support a one-off security type warning that local keybindings would override my global keybindings. But really, making an extension for each project just to add a key shortcut isn't at all logical or intuitive.
I would also like to point out that it is common practice in many repositories to add ignore rules for certain files. If workspace-local keybindings are not expected to end up in a repository, then it is generally a trivial affair to mark them as ignored.
@chrisbward this could probably hook nicely into the new-ish Workspace Trust feature. Workspace tasks are already disabled in "restricted mode." It would probably make sense to disable keyboard shortcuts as well.
I dont understand why this is (still) not possible when a concept of workspace trust exists. Would be quite beneficial to onboard people to projects with shared keybindings for/in tasks.json
.
Came here after creating .vscode/keybindings.json
for a project-specific keybinding and wondering why didn't it work. Please, make it happen! Absolute necessity in some situations. For anyone looking for a workaround, I chose this one:
In the project's .vscode/settings.json
{
...
"workspaceKeybindings.myAwesomeTask.enabled": true
}
In the User keybindings.json
{
...
{
"key": "...",
"command": "workbench.action.tasks.runTask",
"args": "My Awesome Task",
"when": "config.workspaceKeybindings.myAwesomeTask.enabled"
}
}
Happy six year anniversary!
I believe this issue attempts to address part of the reasoning used to dismiss issue https://github.com/microsoft/vscode/issues/4504
If we cannot dismiss it we totally can ignore it. Not a single comment from MS.
This is needed, atleast allow us specify keybindings based on os if that is the concern, I am happy to duplicate keybinding.json to keybindings.macosx.json, keybindings.win.json, keybindings.linux
.
This atleast will allow those who care specifiy a keybinding for their desired os and move on. This is needed please!
I want this to be able to save my keybindings in Github along with the project. I for example work on multiple devices and this would be a great benefit to me.
Ideally the .vscode/keybindings.json
can be activated from .vscode/settings.json
.
This could be handled the same way as settings, where folder settings take priority over workspace settings, which take priority over user settings.
In my opinion this would be very intuitive as people are already used to this system from the way vscode handles settings.
Also the implementation of this feature would be easier that way as the outline is already there from settings.
Additionally nobody is forced to use this feature.
This feature can be especially useful as different project can use different languages. Since there are only limited keys that can be reached comfortably, having language specific keybindings for different project can be very helpful.
You can probably imagine that there are a lot more customization possibilities that I didn't think of and mention here.
Happy six year anniversary!
Almost seven now :)
same as the settings.json, I should be able to specify a local keybindings.json that overrides user keybindings and global keybindings.
A prompt alerting the user to the override and asking which to use might be appropriate.