alefragnani / vscode-project-manager

Project Manager Extension for Visual Studio Code
GNU General Public License v3.0
1.87k stars 222 forks source link

[FEATURE] - Bind shortcut with specified project #714

Closed ahuigo closed 3 months ago

ahuigo commented 7 months ago

I think using keyboard shortcuts to switch to frequently used projects is more convenient than using a dropdown list projects with command+alt+p

Is it possible to bind shortcut with specified project like this?

{
    "name": "docs",
    "shortcut":["ctrl", 1], // bind shortcut here
    "rootPath": "/Users/.../docs",
    "enabled": true
},
alefragnani commented 3 months ago

Hi @ahuigo ,

Unfortunately not. Keyboard shortcuts must be defined upfront by extensions, and there is no API to register keyboard shortcuts. So there would be no way to load a user defined shortcut to register in VS Code.

On the other hand, VS Code supports user defined Keyboard Shortcut, invoking command with arguments https://code.visualstudio.com/docs/getstarted/keybindings#_command-arguments. In this case, the extension could add support to arguments in the projectManager.listProjects command, to filter/find projects with a provided name (using the arguments).

Hope this helps