Productivity Programming

Essential Keyboard Shortcuts for Visual Studio Code

Kris Wouk 30-05-2020

Microsoft Visual Studio Code debuted only a few years ago, but it has quickly become one of the most popular text editors available. Its combination of a simple user interface with powerful IDE-like features makes it especially popular with programmers, but it’s just as useful for writers and anyone who manipulates text files.


Visual Studio Code supports nearly every programming language that exists. If support isn’t built-in, you can add it through the app’s extension browser. VS Code even has native features to support collaborative programming. Plus, it has plenty of keyboard shortcuts to help you navigate the app interface effortlessly.

And what’s more, you can discover the most useful VS Code keyboard shortcuts with this cheat sheet!

Because of the sheer number of users on Windows, that OS is the main focus of this cheat sheet. Don’t worry if you’re a Mac user though, as all of these keyboard shortcuts work on macOS as well. Simply use the Command key instead of the Ctrl key and the Option key instead of Alt. If any shortcuts vary more than that, we’ll mention both.

FREE DOWNLOAD: This cheat sheet is available as a downloadable PDF from our distribution partner, TradePub. You will have to complete a short form to access it for the first time only. Download The Visual Studio Code Keyboard Shortcuts Cheat Sheet.

The Visual Studio Code Keyboard Shortcuts Cheat Sheet

On a Mac keyboard, replace Ctrl with Cmd and Alt with Option in the shortcuts.


Basic Functionality
Ctrl + Shift + POpen Command Palette
Ctrl + ,Open app settings
Ctrl + K, Ctrl + SDisplay keyboard shortcuts
Ctrl + Shift + XSwitch to Extensions pane
Ctrl + NNew file
Ctrl + Shift + NNew window
¹Ctrl + F4Close file
Ctrl + Shift + WClose window
¹F11Toggle Full Screen mode
Ctrl + BToggle sidebar visibility
File Management
Ctrl + OOpen file
Ctrl + SSave file
Ctrl + Shift + SSave as…
Ctrl + K, SSave all files
Ctrl + K, Ctrl + WClose all
Ctrl + Shift + TReopen last closed
Editing Commands
Ctrl + CCopy selection or current line
Ctrl + XCut selection or current line
Ctrl + VPaste
Ctrl + Shift + KDelete line
HomeGo to beginning of line
EndGo to end of line
Ctrl + HomeGo to beginning of file
Ctrl + EndGo to end of file
Alt + Up / DownMove line up or down
Ctrl + ]Indent line
Ctrl + [Outdent line
Ctrl + /Comment out line
Shift + Alt + AComment out region
Ctrl + Shift + [Fold region
Ctrl + Shift + ]Unfold region
Ctrl + K, Ctrl + [Fold all subregions
Ctrl + K, Ctrl + ]Unfold all subregions
Ctrl + K, Ctrl + 0Fold all regions
Ctrl + K, Ctrl + JUnfold all regions
Editor Navigation
Ctrl + PGo to file
Ctrl + GGo to line
Ctrl + TShow all symbols
Ctrl + Shift + OGo to symbol
F8Go to next error or warning
Shift + F8Go to previous error or warning
Ctrl + Shift + MShow Problems panel
¹Alt + LeftGo back
¹Alt + RightGo forward
Find and Replace
Ctrl + FOpen Find dialog
Ctrl + HOpen Replace dialog
Ctrl + Shift + HReplace in files
¹F3Find next
¹Shift + F3Find previous
Alt + EnterSelect all matches for search term
Ctrl + DAdd current selection to Find match
Ctrl + K, Ctrl + DMove previous selection to next Find match
Selection and Multiple Cursors
Ctrl + LSelect current line
Ctrl + Shift + LSelect all instances of current selection
Ctrl + F2Select all matches of current word
¹Shift + Alt + Right ArrowExpand selection
¹Shift + Alt + Left ArrowShrink selection
Alt + ClickInsert cursor
Ctrl + Alt + Up Arrow / Down ArrowInsert cursor above or below current line
Ctrl + UUndo last cursor
Shift + Alt + IInsert cursor at the end of each selected line
Split Editor Management
Ctrl + \Split editor
Ctrl + 1 / 2 / 3Focus on editor pane 1, 2, or 3
Ctrl + K, Ctrl + Right Arrow / Left ArrowFocus on next / previous editor pane
¹Ctrl + Shift + PgUpMove editor left
¹Ctrl + Shift + PgDownMove editor right
Integrated Terminal
¹Ctrl + `Show integrated terminal
¹Ctrl + Shift + `Create new terminal instance
Ctrl + Up Arrow / Down ArrowScroll up / down
Ctrl + Home / EndScroll to top / bottom
macOS-Specific Shortcuts
Cmd + WClose file
Cmd + Ctrl + FToggle full screen
Cmd + -Go back
Cmd + Shift + -Go forward
Cmd + GFind next
Cmd + Shift + GFind previous
Cmd + Control + Shift + Right ArrowExpand selection
Cmd + Control + Shift + Left ArrowShrink selection
Cmd + K, Cmd + Shift + LeftMove editor left
Cmd + K, Cmd + Shift + RightMove editor right
Control + `Show integrated terminal
Control + Shift + `Create new terminal instance
¹The corresponding macOS shortcut is listed under the macOS-Specific Shortcuts section at the end of the cheat sheet.

Looking for More Ways to Make the Most of VS Code?

The keyboard shortcuts here will have you well on your way to becoming a Visual Studio Code power user. That said, there are many more ways that you can make the software even better-suited to your workflow.

For example, you can add countless features to the editor with extensions. If you’re looking for a starting point, take a look at our list of extensions to help make programming in VS Code even easier 9 Visual Studio Code Extensions That Make Programming Even Easier Want more from Visual Studio Code? Need improved tools and productivity options? Try these Visual Studio Code extensions. Read More .

Image Credit: UserName on Unsplash

Related topics: Cheat Sheet, Keyboard Shortcuts, Visual Studio Code.

Affiliate Disclosure: By buying the products we recommend, you help keep the site alive. Read more.

Whatsapp Pinterest

Leave a Reply

Your email address will not be published. Required fields are marked *