Notes On: Visual Studio Code



Beautify C++ code

Shortcut

Shift-Option-F (macOS)

Shift-Alt-F (Windows)



Toggle Terminal View

Menu

View --> Terminal

Shortcut

Ctrl + `



Toggle Display of Primary Side Bar

  • The Activity Bar is the vertical strip of icons on the far left-hand side of the display
  • The Primary Side Bar is displayed just to the right of the Activity Bar
  • Selecting an icon in the Activity Bar changes what is displayed in the Primary Side Bar
    • Explorer, Search, Source Control, Run and Debug, etc.
  • Selecting the icon in the Activity Bar that corresponds to the item that is already displayed in the Primary Side Bar will make the Primary Side Bar disappear.
  • Selecting an icon again in the Activity Bar will cause the corresponding item to appear



Transpose Characters

Ctrl + t



Toggle Auto Save

File --> Auto Save



View Command Palette

Menu

View --> Command Palette

Shortcut

Shift + Command + P



Quick Open File

Command + p
  • Shows recently opened files in list
  • Search by typing
  • Add :line-number after file name to open at a specified line



Multi-Cursor

Insert new additional cursor

Option + Left Mouse Click

Insert cursor at all text matching current selection

Shift + Cmd + L



Disable Sticky Scroll

Sticky Scroll is a feature in VS Code in which as you scroll through your source code the first few lines of the function or method you are in "stick" at the top of the editor window. This is similar to a common behavior of scrolling through a table and having the header rows of the table stay at the top of your display and not go scrolling off the top of your display. I can see where this could be useful when editing/browing source code. But sometimes it just drives me crazy. I know what method/function I'm looking at, and I just want to see as much of the code in the editor window I can as I scroll around.

You can enable/disable it in the Settings for VS Code.

  1. Open the Settings dialog: use Ctrl + , on Windows/Linux or Cmd + , on Mac
  2. Type sticky scroll in the search bar at the top of the Settings dialog
  3. Find Editor --> Sticky Scroll: Enabled and check or uncheck the box to enable or disable this feature.



C_Cpp_Microsoft
C/C++ by Microsoft

C_Cpp_Extension_Pack_Microsoft
C/C++ Extension Pack by Microsoft

C_Cpp_Themes_Microsoft
C/C++ Themes by Microsoft

Docx_Viewer_Reader_Kumar
Docx Viewer/Reader by Shahil Kumar

IntelliCode_Microsoft
IntelliCode by Microsoft

Open_External_YuTengjing
Open in External App by YuTengjing

vscode-pdf_tomoki1207
Display PDF file in VSCode by tomoki1207