DEV Community

Code navigation in Visual Studio Code

Sergiu Mureşan on November 16, 2018

The navigation features look straightforward, but, at first glance, they don't seem very useful. So, for this part of the tutorial I suggest you on...
Collapse
 
jeikabu profile image
jeikabu • Edited

I move back and forth between Windows (at work) and Mac (at home) a lot. The thing that always melts my mind is VS Code shortcuts that are almost the same (e.g. ctrl + b vs cmd + b), and short-cuts that are completely different (e.g. ctrl + k, s vs opt + cmd + s). T_T

Also, ctrl + shift + p to open the command palette is a good one.

Collapse
 
codevault profile image
Sergiu Mureşan

I wonder why they chose to do this... On Windows, some of them are very similar to Visual Studio's shortcuts.

Opening the command palette is one of the shortcuts I always forget due to using CTRL + P and just prefixing my search with >.

Collapse
 
parkerholladay profile image
Parker Holladay

That is the sole reason I didn't recently replace my old work laptop with a Mac. I couldn't get over how nonsensical the apparently random switches between cmd and ctrl were.

Collapse
 
renannobile profile image
Renan Lourençoni Nobile • Edited

Great post, shortcuts are THE BOMB.

I consider myself a avid shortcut user and here are some more:

  • ctrl + r: open recent project
  • ctrl + q: open views panel (release ctrl to select)
  • ctrl + b: toggle side panel
  • ctrl + shift + g: open source control
  • ctrl + shift + x: open extensions panel
  • ctrl + shift + e: open project explorer
  • ctrl + shift + f: open search panel
  • ctrl + \`: toggle terminal
  • ctrl + shift + \`: open new terminal
  • ctrl + p: go to file
  • ctrl + n: start new file
  • ctrl + shift + n: start new VS Code instance
  • ctrl + shift + c: open external terminal on current project root
  • ctrl + w: close current file
  • ctrl + pageup/pagedown: navigate to next/previus opened file

There are a lot more shortcuts, but these are the ones I use the most.

Collapse
 
joestrouth1 profile image
Joe Strouth

These are great. Another one I use if using split view:

  • ctrl + [1, 2, 3...]: Focus the [first, second, third...] open panel. Splits to create another panel if one doesn't exist.