Visual Studio Code Keyboard Shortcuts

I am finding Visual Studio Code to be very useful as a light IDE and editor for C++ and Python code on Linux.

Some keyboard shortcuts that I find useful:

Ctrl + B:         Toggle sidebar
Ctrl + P:         Search for file to open
Ctrl + Shift + F: Search for text in files
Ctrl + Shift + P: Editor commands
Ctrl + G:         Jump to line number
Ctrl + Tab:       Switch between open editors
Ctrl + Shift + O: Jump to symbol in current file
Ctrl + T:         Jump to symbol in current workspace
Ctrl + `:         Open terminal
F12:              Go to definition
Ctrl + Alt + -:   Go back
Ctrl + /:         Toggle line comment
Alt  + Shift + 1: Toggle between vertical and horizontal split windows

Some user interface tips:

  • Single click on filenames in the Side Bar opens files into the same editor tab, replacing the earlier one. This is useful when browsing through files. Notice that the filename is in italics on the editor tab in this mode.

  • Double click on filenames in the Side Bar opens file in a new editor tab. The file owns that editor tab. Notice that the filename is not in italics on the editor tab.

  • Ctrl + single click on filename in Side Bar to open it in existing editor tab in second vertical split.

  • Ctrl + double click on filename in Side Bar to open it in new editor tab in second vertical split. This file will own the tab.

  • What if you opened a file using single click, but now wish it owned the tab, so that it will not be replaced when you open next file? Aha, Visual Studio Code has you covered! Double click the filename on the tab. You will see that the italics is removed. The file now owns this tab.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s