Increasing Productivity Using Shortcut Customization In Visual Studio Code (vs Code)
Table of contents
Getting Started
Have you ever used Visual Studio Code and struggled to recall which shortcut key to press for a specific task or were unsure of how to use a specific shortcut key?
In this article, I'll show you how to modify Visual Studio Code keyboard shortcuts to make them easier to remember.
Steps
Navigate to the keyboard shortcut window: to do this, press ctrl + k, ctrl + s on your keyboard in vs code, after doing that, you should see something similar to this:
Look for the desired shortcut key to change: select any keyboard shortcut key you would like to change or simply type the intended shortcut into the search box, as in the image below:
In this article for a better explanation, we'll be switching the
"File: Save"
command from Ctrl + s to Ctrl + Alt + HSelect the command with your desired key binding: click on the key binding combination that matches your desired shortcut key to highlight it.
In this instance, I've selected Ctrl + s key binding for The
"File: Save"
commandEdit your key binding shortcut: click on the edit button (pencil icon) to the right of the highlighted command
NB: Verify that the shortcut key binding corresponds to the shortcut command e.g.
Ctrl + s
matches with"File: Save"
This would then pop up a modal asking you to input a new shortcut key combination. In this instance, we are changing the highlighted
"File: Save"
command from Ctrl + s to Ctrl + Alt + HAfter inputting your new shortcut command, press the enter key to save your new key binding. This will update your
keybinding.json
file. Voila! ๐,"File: Save"
command has been successfully changed from Ctrl + s to Ctrl + Alt + H.Confirming the new key binding: to confirm the new key binding, we can go back to the keyboard shortcut tab and search for the command of our previous key binding, e.g. "File: Save" In the example below,
As you can see, in the image above the
"File: Save"
command now has a key binding of Ctrl + Alt + H. You can test the new key binding by typing the new keyboard shortcut and seeing if the command was executed.Below is a list of key binding combinations that are acceptable:
//Modifiers Ctrl+, Alt+, Shift+, Win+ //Keys f1-f19, a-z, 0-9 numpad_subtract, numpad_decimal, numpad_divide `, -, =, [, ], \, ;, ', ,, ., / tab, enter, escape, space, backspace, delete pausebreak, capslock, insert numpad0-numpad9, numpad_multiply, numpad_add, numpad_separator left, up, right, down, pageup, pagedown, end, home
Conclusion
You might want to execute some task in Visual Studio Code using shortcut keys and you find it hard to recall any of the shortcut keys, but with the help of this article, it shouldn't be a problem as you can now modify shortcut keys and make them easier to remember. I hope you enjoyed the article; please leave me a comment if you have any questions or suggestions.