Visual Studio Code Tricks – #keyboard shortcuts #keybindings

It has been a while since Visual Studio Code is released now.  While documentation is more than enough to dig and find out what you need, this blog contains list of things I learnt and found to be very helpful.

One of the first things you might want to learn is CTRL + SHIFT +  P 

Above command is the key to the kingdom (of VSCode Commands). In other words, it shows you all the commands you need to operate Visual Studio Code. While you can access many commands starting with above one command, I will use it here just to make a case and then will let you run with it.

Case : How can I find shortcut to the “keyboard shortcuts” for VSCode ?

 

Press magic command “CTRL + SHIFT +  P” and then type keyboard

vscode-commands

 

If you’d rather print a page of out of the box keybindings, no problem ! Following link should let you do that.

https://code.visualstudio.com/shortcuts/keyboard-shortcuts-windows.pdf

If you forgot to bookmark the link or just want to this link from keyboard then here is the shortcut. Press “CTRL + K” and “CTRL + R”  

 

Moving on to the next topic on keyboard shortcuts a.k.a. keybindings. Just like Visual Studio (Professional / Enterprise /Community ) you can override the default keyboard bindings. This is handy and at times must feature for developers who want to avoid mouse as much as possible !

  1.  Press “CTRL + K” and “CTRL + S” this should open keyboard settings page.
  2. Now to select your own keybinding first Press CTRL + K and CTRL + K
  3. Press the keybindings you wish to assign example CTRL + SHIFT + L
  4. Change text in the right hand side to following and Save

// Place your key bindings in this file to overwrite the defaults
[
{
“key”: “ctrl+shift+l”,
“command”: “workbench.action.toggleFullScreen”
//This can also be achieved with F11
}
]

kkksfinal

How to overwrite out of the box keybindings

Of course, it will take sometime before you become ninja for VSCode keyboards unless you are keyboard shortcut pro for Visual Studio.

If you are interested and want to read more on keyboard shortcuts etc… read this inspiring blog by Scott Hanselman !

References :

https://code.visualstudio.com/docs/customization/keybindings

Advertisements