Double shift key in Visual Studio Code
For a long time, I worked with PhpStorm to write PHP and some Javascript. But my needs have evolved, and I’m going to move towards a stack using Typescript. So I decided to try Visual Studio Code.
Question comes: How can I avoid losing my keyboard shortcuts? The main obstacle to changing text editors is the modification of keyboard shortcuts, and therefore of automatisms/habits. So the IntelliJ IDEA Keybindings extension fits this case almost perfectly.
Issue: The IntelliJ IDEA Keybindings extension does not support the quick open file (shift shift
) available in PhpStorm. The equivalent in Vscode is ctrl+p
but it’s overloaded by the IntelliJ IDEA Keybindings extension. We are therefore unable to use this native shortcut.
You will tell me that I can change the configuration of the keyboard shortcuts but I’m keen on the shift shift
. This is a game changer, once you have used it, you can’t go back.
Solutions: You need to put this to your keybindings.json:
{
"key": "shift shift",
"command": "workbench.action.quickOpen"
}
This solution is valid from Vscode release 1.54.1 or higher.
Here is the link to the changelog of the feature: https://code.visualstudio.com/updates/v1_54#_modifier-only-keybindings
Bonus:
Other keyboard shortcuts using a non-modifier key:
{
"key": "alt alt",
"command": "workbench.action.showCommands"
},
{
"key": "ctrl ctrl",
"command": "workbench.action.toggleSidebarVisibility"
}
Thanks to the Vscode community on Github for this feature.
Source: https://github.com/microsoft/vscode/issues/5280#issuecomment-792729308