VSCode Cheat Sheet [Free PDF Download]

LINUX
FUNDAMENTALS
A Complete Guide for Beginners Enroll Course Now

VSCode (Visual Studio Code) is a powerful source code editor designed extensively by Microsoft. This editor is quite popular because of its simplicity and versatile functionality. It is suitable for both beginners and experts as it provides a flexible environment for multiple frameworks. In this article, I will demonstrate a VSCode Cheat sheet which serves as a handy reference guide and lets anyone utilize the efficient capabilities of this code editor. Let’s explore the article together!

Download the VSCode Cheat Sheet

VSCode cheat sheet front image

Available Download Options


Most Popular

PDF (4 Pages)

DOC (4 Pages)

Combo Pack

ZIP (pdf, docx, png)

Keyboard Shortcuts for VSCode

In VSCode editor, there is a wide range of keyboard shortcuts for performing every action. These shortcuts are really helpful for unfolding working productivity. Have a look in the following section to get a broad list of keyboard syntax of VSCode.

Getting Started

Here are some shortcuts of VSCode to help you get started, run, and exit:

Shortcut Keys Description
CTRL + SHIFT + P Open command palette
CTRL + SHIFT + N New window
CTRL + SHIFT + W Close window
CTRL + , User settings
CTRL + K + CTRL + S Keyboard shortcuts
CTRL + K + CTRL + O  Open workspace

Navigation

Navigation shortcuts help you to navigate through any function of the code editor. Here are some commonly used navigation keystrokes in VSCode:

Shortcut Keys Description
CTRL + P Go to File
CTRL + G Go to Line
CTRL + T Show all symbols
CTRL + SHIFT + M Show problems panel
SHIFT + F8 Go to previous error 
F8 Go to next error 
CTRL + SHIFT + TAB Navigate editor group history
ALT + ← / → Go back/forward
CTRL + M Toggle Tab moves focus

File Handling

Using VSCode shortcuts, you can perform file-handling operations like creating, opening, saving, and deleting files. Some file-handling shortcuts are given below:

Shortcut Keys Description
CTRL + N Create new file
CTRL + O Open file
CTRL + S  Save file
CTRL SHIFT + S Save as…
CTRL + K + S Save all
CTRL + W  Close file
CTRL + K + CTRL + W Close all
CTRL + K + P Copy path of active file
CTRL + K + R Reveal active file in explorer
CTRL + K + O Show active file in new window

Editing

There are several editing features and shortcuts in VSCode that will help you to alter indentation, alignment, and spacing. Check out the following section for editing by using the VSCode syntax:

Shortcut Keys Description
CTRL + C Copy line
CTRL + X Cut line
CTRL + / Toggle line comment 
SHIFT + ALT + A Toggle block comment
CTRL + ] Indent line
CTRL + [ Outdent line
CTRL + SHIFT + D Duplicate line
CTRL + SHIFT + K Delete line
SHIFT + ALT + F Format document
CTRL + K + CTRL + F Auto indent lines
CTRL + SHIFT + ENTER Insert line above
CTRL + ENTER Insert line below
CTRL + SHIFT + \ Jump to matching bracket
CTRL + HOME Go to beginning of file
CTRL + END Go to end of file
CTRL + SHIFT + [ Fold region
CTRL + K + CTRL + 0 Fold all regions
CTRL + SHIFT + ] Unfold region
CTRL + K + CTRL + J Unfold all regions
CTRL + K + CTRL + C Add line comment
CTRL + K + CTRL + U Remove line comment
ALT + Z Toggle word wrap
F12 Go to definition
ALT + F12 Find all references
CTRL + K + F12 Peek definition
F2 Rename symbol
CTRL + . Quick fix
CTRL + K + M Change file language
CTRL + K + CTRL + X Remove trailing whitespace

Regex

VSCode consists of an impressive arrangement of Regex (Regular Expression). For searching, replacing and conveniently manipulating text, the following regex syntax will be helpful to you:

Shortcut Keys Description
* Match zero or more occurrences
+ Match one or more occurrences
? Match zero or one occurrence
^ Match the beginning of a line
$ Match the end of a line
\b Match a word boundary
\B Match a non-word boundary
{n} Match exactly n occurrences
{n,} Match at least n occurrences
{n,m} Match between n and m occurrences
[abc] Match any single character a, b, or c
(abc) Group multiple expressions together
[0-9] Match any single-digit
[a-z] Match any single lowercase letter
[A-Z] Match any single uppercase letter
\1,\2,… Backreferences to captured groups

Search & Replace

VSCode offers extensive search & replace shortcuts that allow you to find a specific text and replace it with another string. Check out the keyboard shortcuts for search & replace below:

Shortcut Keys Description
CTRL + F Find toolbar
CTRL + SHIFT + F  Enable case-sensitive search in files
ALT + R Replace regular expression 
ALT + C Enable case sensitive replace
CTRL + H Open replace panel
SHIFT + ALT + ENTER Replace the previous occurrence
ALT + ENTER  Replace the next occurrence
F3 Search next occurrence
SHIFT + F3 Search previous occurrence
CTRL + D Add selection to next search match
CTRL + K + CTRL + D Move last selection to next search match

Editor Management

Editor management lets you manage the editor layout and workspace to sort out the codes effectively. Here are some keystrokes for editor management operation in VSCode:

Shortcut Keys Description
CTRL + F4 Close editor
CTRL + K + ENTER Open preview mode editor 
CTRL + SHIFT + T Reopen closed editor
CTRL + K + F Close folder
CTRL + TAB Cycle forward through tabs
CTRL + SHIFT + TAB Cycle backward through tabs
CTRL + TAB Switch to next editor
CTRL + SHIFT + TAB Switch to previous editor
CTRL + \ Split editor
CTRL + 1/2/3 Switch between editor groups
CTRL + ALT + ← / → Navigate between editor groups

Display

You can create a customized coding environment by applying different display features and options. Following are some essential shortcuts for VSCode display:

Shortcut Keys Description
F11 Toggle full screen
CTRL + J Toggle panel
CTRL + B Toggle sidebar
SHIFT + ALT + 0 Toggle editor layout 
CTRL + = Zoom in
CTRL + – Zoom out
CTRL + SHIFT + E Show explorer
CTRL + SHIFT + G Show source control
CTRL + SHIFT + F Show search
CTRL + SHIFT + D Show debug
CTRL + SHIFT + X Show extensions
CTRL + SHIFT + J Toggle search details
CTRL + SHIFT + U Show output panel
CTRL + SHIFT + V Toggle preview mode for markdown file
CTRL + K + V Show markdown preview to the side
CTRL + K + Z Enter Zen mode
CTRL + K + X Enter Focus mode

Version Control

Version control lets you manage the streamlined source code by enabling track changes and maintaining version history. Here are some of the shortcuts of the version control feature in VSCode:

Shortcut Keys Description
CTRL + SHIFT + G Open source control view
CTRL + ENTER Stage changes
CTRL + ENTER + CTRL + ENTER Commit changes
CTRL + SHIFT + ENTER Push commits

Debugging

Some essential keyboard shortcuts for debugging functions in VSCode:

Shortcut Keys Description
F5 Start debugging
CTRL + F5 Start without debugging script
SHIFT + F5 Close debugging
F9 Toggle breakpoint
CTRL + F9 Enable/disable breakpoint
SHIFT + F9 Toggle conditional breakpoint
CTRL + SHIFT + F9 Add a logpoint
F10 Step over
F11 Step into
SHIFT + F11 Step out
CTRL + SHIFT + Y  Open/close debug console
CTRL +  K + CTRL + I Show hover

Terminal

Through VSCode terminal, you can run codes, execute commands and scripts. Here is some shortcut syntax for the terminal in VSCode:

Shortcut Keys Description
CTRL + ` Toggle terminal
CTRL + SHIFT + ` Create new terminal
CTRL + F5 Run terminal
CTRL + K Clear terminal
CTRL + SHIFT + F5 Stop or restart terminal

Selection

Using the keybindings below, you can perform the selection operation properly in VSCode:

Shortcut Keys Description
CTRL + L Select line
CTRL + SHIFT + L Select all occurrences of current selection
CTRL + F2 Select all occurrences of current word
CTRL + SHIFT + ALT + → Select current block
ALT + ↑ Move selection up
ALT + ↓ Move selection down
SHIFT + ALT + ↑ Copy selected lines up
SHIFT + ALT + ↓ Copy selected lines down
CTRL + A Select all
CTRL + SHIFT + → Expand selection
CTRL + SHIFT + ← Shrink selection
CTRL + SHIFT + ALT + ARROWS OR SHIFT + ALT +  (DRAG MOUSE) Column (Box) selection mode
CTRL + SHIFT + ALT + PageUP/PageDown Column (Box) selection page up/down
SHIFT + ALT + ARROWS Extend column selection
ESC Remove column (Box) selection

Multiple Cursors

When you want to make changes repeatedly or perform bulk edits, you can use the multiple cursor feature. Here’s how to use multiple cursors in VSCode:

Shortcut Keys Description
ALT + CLICK Insert cursor
CTRL + ALT + ↑ Add cursor above
CTRL + ALT + ↓ Add cursor below
CTRL + D Add cursor to next occurrence
CTRL + K + CTRL + D Skip occurrence
CTRL + U Undo last cursor operation
SHIFT + ALT + I Insert cursor at end of each line selected

Extension

VSCode contains an enriched extension that allows you to customize functions according to your needs. Here’s an overview of VSCode extensions:

Shortcut Keys Description
CTRL + SHIFT + X Open extensions view
CTRL + SHIFT + P Show recommended extensions
CTRL + , Open extension settings

Conclusion

The VSCode cheat sheet is a valuable resource to anyone who wants to investigate the VSCode editor strongly in an interactive way. So, give it a try, optimize and accelerate your workflow with this rich feature code editor.

People Also Ask

What is the VS Code?

Visual Studio Code, often abbreviated as VS Code, is a free source code editor developed by Microsoft. It is available for Windows, MacOS, and Linux. It provides developers with a customized interface, extensive language support, and a rich ecosystem of extensions to boost productivity.

How do I install VS Code in my system?

To install VS Code in your system:

  1. Visit the VS Code official website and download the appropriate installer that suits your operating system type and system architecture.
  2. Run the downloaded installer and follow the on-screen instructions.
  3. Once installed, run VS Code from the search bar by typing VS Code or from the applications menu.

How do I integrate version control (e.g. Git) in VS Code?

To integrate version control such as Git in VS Code, install Git on your system, and VS Code will recognize it automatically. Use the version control features available in the sidebar to manage repositories, commits, and branches.

5/5 - (3 votes)
Nadiba Rahman

Hello, This is Nadiba Rahman, currently working as a Linux Content Developer Executive at SOFTEKO. I have completed my graduation with a bachelor’s degree in Electronics & Telecommunication Engineering from Rajshahi University of Engineering & Technology (RUET).I am quite passionate about crafting. I really adore exploring and learning new things which always helps me to think transparently. And this curiosity led me to pursue knowledge about Linux. My goal is to portray Linux-based practical problems and share them with you. Read Full Bio

Leave a Comment