Skip to main content

Essential Keyboard Shortcuts for Visual Studio Code

Laptop displaying text editor

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.

Shortcut Action
Basic Functionality
Ctrl + Shift + P Open Command Palette
Ctrl + , Open app settings
Ctrl + K, Ctrl + S Display keyboard shortcuts
Ctrl + Shift + X Switch to Extensions pane
Ctrl + N New file
Ctrl + Shift + N New window
¹Ctrl + F4 Close file
Ctrl + Shift + W Close window
¹F11 Toggle Full Screen mode
Ctrl + B Toggle sidebar visibility
File Management
Ctrl + O Open file
Ctrl + S Save file
Ctrl + Shift + S Save as…
Ctrl + K, S Save all files
Ctrl + K, Ctrl + W Close all
Ctrl + Shift + T Reopen last closed
Editing Commands
Ctrl + C Copy selection or current line
Ctrl + X Cut selection or current line
Ctrl + V Paste
Ctrl + Shift + K Delete line
Home Go to beginning of line
End Go to end of line
Ctrl + Home Go to beginning of file
Ctrl + End Go to end of file
Alt + Up / Down Move line up or down
Ctrl + ] Indent line
Ctrl + [ Outdent line
Ctrl + / Comment out line
Shift + Alt + A Comment out region
Folding
Ctrl + Shift + [ Fold region
Ctrl + Shift + ] Unfold region
Ctrl + K, Ctrl + [ Fold all subregions
Ctrl + K, Ctrl + ] Unfold all subregions
Ctrl + K, Ctrl + 0 Fold all regions
Ctrl + K, Ctrl + J Unfold all regions
Editor Navigation
Ctrl + P Go to file
Ctrl + G Go to line
Ctrl + T Show all symbols
Ctrl + Shift + O Go to symbol
F8 Go to next error or warning
Shift + F8 Go to previous error or warning
Ctrl + Shift + M Show Problems panel
¹Alt + Left Go back
¹Alt + Right Go forward
Find and Replace
Ctrl + F Open Find dialog
Ctrl + H Open Replace dialog
Ctrl + Shift + H Replace in files
¹F3 Find next
¹Shift + F3 Find previous
Alt + Enter Select all matches for search term
Ctrl + D Add current selection to Find match
Ctrl + K, Ctrl + D Move previous selection to next Find match
Selection and Multiple Cursors
Ctrl + L Select current line
Ctrl + Shift + L Select all instances of current selection
Ctrl + F2 Select all matches of current word
¹Shift + Alt + Right Arrow Expand selection
¹Shift + Alt + Left Arrow Shrink selection
Alt + Click Insert cursor
Ctrl + Alt + Up Arrow / Down Arrow Insert cursor above or below current line
Ctrl + U Undo last cursor
Shift + Alt + I Insert cursor at the end of each selected line
Split Editor Management
Ctrl + \ Split editor
Ctrl + 1 / 2 / 3 Focus on editor pane 1, 2, or 3
Ctrl + K, Ctrl + Right Arrow / Left Arrow Focus on next / previous editor pane
¹Ctrl + Shift + PgUp Move editor left
¹Ctrl + Shift + PgDown Move editor right
Integrated Terminal
¹Ctrl + ` Show integrated terminal
¹Ctrl + Shift + ` Create new terminal instance
Ctrl + Up Arrow / Down Arrow Scroll up / down
Ctrl + Home / End Scroll to top / bottom
macOS-Specific Shortcuts
Cmd + W Close file
Cmd + Ctrl + F Toggle full screen
Cmd + - Go back
Cmd + Shift + - Go forward
Cmd + G Find next
Cmd + Shift + G Find previous
Cmd + Control + Shift + Right Arrow Expand selection
Cmd + Control + Shift + Left Arrow Shrink selection
Cmd + K, Cmd + Shift + Left Move editor left
Cmd + K, Cmd + Shift + Right Move 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.

Image Credit: UserName on Unsplash

Read the full article: Essential Keyboard Shortcuts for Visual Studio Code

Comments

Popular posts from this blog

The Best 10 Social Media Platforms for Photographers to Flaunt Their Talent

Social media offers an excellent opportunity for photographers to connect with potential clients. In the digital era, it's a great asset. By showcasing your work on these networks, you can reach new audiences. Whether you are a professional or freelance photographer, the following social platforms will help you show off your work and get the right people to take notice... 1. Behance Behance is a classic portfolio publishing network that functions like a LinkedIn for creatives. Designed by Adobe, this is one of the best photography networking sites currently out there. The platform is ideal for sharing your portfolio and favorite images, allowing other Behance users to like and comment on your photos. By learning from their feedback and professional critiques, you can improve your work. The coolest feature of Behance is that it lets you find professional gig opportunities right on the platform. With your portfolio already available on the site, getting work becomes effortless.

The 6 Best Platforms for Sharing Your Digital Art Online

Whether you're looking for somewhere to host your digital art portfolio or simply want to share your latest artworks, it can be difficult to choose a website to upload to. Or at least, it definitely is more so than before, now that art websites aren't bubbling with as much excitement as they used to be. You know that each site has its pros and cons, but it's hard to figure out what those are unless you make an account and see for yourself. Don't worry if you don't have time for that—we've got your back. Here are the websites we recommend for sharing digital art, and why you might want to consider them. 1. Pixiv If you were around when the online art scene was ridiculously active, chances are that your art style is influenced by anime and/or manga in some way. Otaku culture began its slow sneak into mainstream media back then, and Pixiv is a great home for artists that fall in that category. Pixiv started as a small online community based in Japan, but has s

Snapchat Suspends Two Anonymous Messaging Apps Over Cyberbullying Claims

In light of a lawsuit that was filed earlier, two Snapchat apps, Yolo and LMK have been suspended by Snap. The apps allowed users to send anonymous messages on the platform. The Lawsuit Calls for an Immediate Ban of Yolo and LMK According to a LA Times report, the lawsuit was filed on behalf of Kristin Bride, the mother of a teen who committed suicide in 2020. The lawsuit alleges that Bride's son took his own life after being cyberbullied via Yolo and LMK. In addition to this, the lawsuit alleges that Yolo and LMK aren't doing enough to tackle cyberbullying, and have consequently violated consumer protection law as well as their own terms of service and policies. Both apps use Snap Kit, a set of tools that allows developers to directly connect to Snapchat for better integration features. Today the family of a 16-year-old Oregon boy who took his own life after being cyberbullied sued Snap and the makers of apps YOLO and LMK, alleging that the companies should be "h