Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

A keybindings.json per workspace in Visual Studio Code

Tags:

Is it possible to have a keybindings.json as part of the workspace settings instead of the user settings?

Since I have specific tasks associated to my workspace, I would also like to be able to assign workspace-specific shortcuts. Because I would use these shortcuts on my separate Windows and Linux environments, I would not prefer to see these key binding definitions end up amongst my environment-specific user settings.

like image 891
Aris Koning Avatar asked Feb 23 '18 10:02

Aris Koning


People also ask

How do I add Keybindings to Visual Studio Code?

All keyboard shortcuts in VS Code can be customized via the keybindings. json file. To configure keyboard shortcuts through the JSON file, open Keyboard Shortcuts editor and select the Open Keyboard Shortcuts (JSON) button on the right of the editor title bar. This will open your keybindings.

How do I open workspace settings json in VS Code?

Open the command palette (either with F1 or Ctrl + Shift + P ) Type "open settings" You are presented with two options, choose Open Settings (JSON)

Where can I find Keybindings json?

On Windows: go to File -> Preferences -> Keyboard shortcuts, or press Ctrl+K, then Ctrl+S, or edit %UserProfile%\AppData\Roaming\Code\User\keybindings. json file.

What is workspace settings in VS Code?

Workspace settings are specific to a project and can be shared across developers on a project. Workspace settings override user settings. Note: A VS Code "workspace" is usually just your project root folder. Workspace settings as well as debugging and task configurations are stored at the root in a . vscode folder.


1 Answers

This is not possible. Here Alexandru Dima (alexandrudima) explains why they do not want to add this feature and furthermore suggests to create your custom extension that contributes only keybindings to share them.

like image 158
HaaLeo Avatar answered Sep 27 '22 15:09

HaaLeo