Academind Logo

10 Visual Studio Code Shortcuts You Should Know

Manage your code efficiently in Visual Studio Code with the command palette, by easily switching between files & projects or by quickly moving or updating code sections.

Created by Manuel Lorenz

#

Command Palette

The Command Palette is one of VS Code's most popular features with quick access to all tools and commands within VS Code.

Activated with Shift + Command + P (macOS) or Shift + Ctrl + P (Windows), it provides two major features:

  • Direct File access to all current project files (instead of searching for files in the explorer)

  • VS Code Feature Access

The command "Preferences: Open Keyboard Shortcuts" opens the keyboard shortcuts menu where all of the following command and the corresponding keybindings can be found and edited.

#

Go To File...

Go To File , accessible via Ctrl + P allows you to quickly search and jump to any file within your current project, saving you the hassle of manually browsing through the explorer. This feature is indispensable for working on large projects with numerous files.

#

Search: Find in Files

The default search function, Cmd + F (macOS) & Ctrl + F (Windows), limits your search to your current file.

Shift + Command + F (macOS) or Shift + Ctrl + F (Windows) opens the door to project-wide search functionality. Unlike the basic search, "Find in Files" looks through every file in your project, ensuring that no stone is left unturned in your search queries.

#

File: Open Recent

Switching between projects is seamless with the File: Open Recent feature, accessible via CTRL + R.

This functionality keeps a handy list of your recently accessed projects, allowing you to switch contexts without breaking your workflow. It’s a simple yet effective way to manage multiple projects simultaneously.

#

View: Toggle Terminal

The integrated terminal is a feature that underscores VS Code's versatility, offering you the convenience of running shell commands directly within the editor. Toggling the terminal is as easy as using Shift + Ctrl + `, enabling you to compile code, manage version control, or install packages without ever leaving VS Code.

#

Toggle Line Comment

Commenting out lines of code is a common necessity, and VS Code makes this task straightforward with the Toggle Line Comment shortcut (Shift + Command + 7 on macOS or Shift + Ctrl + 7 on Windows).

This shortcut instantly comments or uncomments the current line or selected block, streamlining the process of testing different parts of your code.

#

Move Line Up / Down and Holding ALT

Rearranging single or multiple lines of code is a breeze with the Move Line Up/Down feature, activated with Alt + Up/Down.

Moreover, holding the Alt key allows you to select and edit multiple instances of code across different locations, enhancing your ability to refactor and manage your code efficiently.

#

Add Selection to Next Find Match

The Add Selection to Next Find Match shortcut (Cmd + D on macOS or Ctrl + D on Windows) is a powerful tool for simultaneous editing. By selecting a word and repeatedly pressing this shortcut, you can select other instances of the word, allowing for batch editing that can significantly speed up your coding process.

#

Format Document

One of the most appreciated features for keeping your code neat and readable is Format Document, triggered by Shift + Option + F on (macOS) or Shift + Alt + F (Windows).

This feature automatically formats your code according to the language-specific settings and extensions you've installed, ensuring your project adheres to consistent styling and readability standards.

Recommended Courses