Introduction

This blog post will discuss the twenty-nine essential Visual Studio Code shortcuts to help Mac and Windows users be more productive in 2024.

In today’s fast-paced software development world, every second counts. That’s why developers are always looking for ways to boost their productivity and efficiency.

One of the most effective ways to do this is using keyboard shortcuts. For example, visual Studio Code (VSCode) is a popular code editor developers use to write, debug, and run code.

What Are VS Code Shortcuts?

Visual Studio Code (VSCode) shortcuts are keyboard combinations that allow users to perform various actions, such as editing code, navigating through code, managing files, folding and unfolding code, debugging, and customizing settings, quickly and efficiently without using a mouse.

These shortcuts are designed to save time and improve productivity for developers working in VSCode. They vary for Mac and Windows systems and can be customized to meet the user’s individual needs.

How Do You Use VS Code Shortcuts?

To use Visual Studio Code (VSCode) shortcuts, press the specified key combination on your keyboard. Here are the steps to use VSCode shortcuts:

  1. Open Visual Studio Code: Start VSCode by opening it from your start menu or clicking on its desktop icon.
  2. Select the text or action you want to perform: To perform an action using a shortcut, you first need to select the text or action you want to perform. This can be done using your mouse or keyboard.
  3. Press the specified key combination: Once you have selected the text or action, press the specified key combination for the desired shortcut. For example, to copy text in VSCode, you can press Cmd + C on a Mac or Ctrl + C on a Windows computer.
  4. The action will be performed: The shortcut will trigger the desired action, such as copying, pasting, or navigating through code, saving you time and effort.

29 Essential VS Code Shortcuts For Mac & Windows

I. Basic Code Editing Shortcuts

One of the most important aspects of writing code is editing. Visual Studio Code provides several basic editing shortcuts that allow developers to save time and effort. Below are six essential shortcuts to start you off.

ActionMacWindows
CopyCmd + CCtrl + Shift + Z
CutCmd + XCtrl + Shift + Z
PasteCmd + VCtrl + Shift + Z
UndoCmd + ZCtrl + Shift + Z
RedoCmd + Shift + ZCtrl + Shift + Z
Select AllCmd + ACtrl + A
Delete LineCmd + Shift + KCtrl + Shift + K
Format DocumentCmd + Shift + iCtrl + Shift + i
Toggle CommentCmd + /Ctrl + /
Toggle Block CommentCmd + Shift + /Ctrl + Shift + /
Basic VS Code Editing Shortcuts on Mac & Windows

II. Code Navigation Shortcuts

Navigating through code can be a challenge, especially in large projects. Visual Studio Code provides several shortcuts to help developers navigate their code more efficiently. Here are three of the most helpful code navigation shortcuts in VSCode:

ActionMacWindows
Go to DefinitionCmd + ClickCtrl + Click
Peek DefinitionCmd + Shift + F10Ctrl + Click
Find All ReferencesCmd + Shift + F12Ctrl + Click
Visual Studio Code Code Navigation Shortcuts

III. Multi-Cursor Shortcuts

Working with multiple cursors can be a time-saving technique when writing code. Also, these shortcuts come in handy when you need to manipulate several lines of code simultaneously.

Here are three Multi-Cursor Shortcuts:

ActionMacWindows
Add Cursor AboveAlt + Up ArrowShift+Alt+Down
Add Cursor BelowAlt + Down ArrowShift+Alt+Up
Select Next OccurrenceCmd + DCtrl + D
Visual Studio Code Multi-Cursor Shortcuts

IV. File Management Shortcuts

Managing files and projects can be pretty tedious, especially when working on large code bases. Visual Studio Code has several file management shortcuts to help developers wade through files and folders in their projects.

Here are the three most useful file management shortcuts in Visual Studio Code:

ActionMacWindows
Open Command PaletteCmd + Shift + PCtrl + Shift + P
Open a FileCmd + PCtrl + P
Save a FileCmd + SCtrl + S
Visual Studio Code File Management Shortcuts

V. Code Folding Shortcuts

Folding and unfolding code can be a time-saving technique when working with files with hundreds or thousands of lines of code.

These are three of the most useful code folding shortcuts in VS Code:

ActionMacWindows
Fold RegionCmd + Shift + [Ctrl + Shift + [
Unfold RegionCmd + Shift + ]Ctrl + Shift + ]
Fold All RegionsCmd + K, Cmd + 0Ctrl + K, Ctrl + 0
Visual Studio Code Code Folding Shortcuts

VI. VS Code Debugging Shortcuts

Debugging is an essential part of the software development process. However, it can be time-consuming, as bugs are very good at hiding. These shortcuts will help in your debugging sessions:

ActionMacWindows
Start DebuggingF5F5
Step OverF10F10
Step Into / Step Out OfF11F11
Stop DebuggingF5F5
Visual Studio Code Debugging Shortcuts

VII. Visual Studio Code Settings Shortcuts

Customizing the settings of Visual Studio Code can be a time-consuming process. To optimize your developer workflow, you should customize your IDE to your liking. You can use these three shortcuts to get going with configuring your VS Code;

ActionMacWindows
Open SettingsCmd + ,Ctrl + ,
Open KeybindingsCmd + K, Cmd + SCtrl + K, Ctrl + S
Open ExtensionsCmd + Shift + XCtrl + Shift + X
Visual Studio Code Settings Shortcuts

Conclusion

Mac and Windows users can significantly increase their productivity and efficiency when writing, debugging, and running code using these essential Visual Studio Code shortcuts.

It may take some time to get used to these shortcuts, but once they become second nature, you’ll be amazed at how much time you save.

Remember, the more you use these shortcuts, the more intuitive they will become. Happy coding!

If you need to boost your productivity even more, here are my Top 10 Useful VS Code Extensions For Software Developers in 2024.

Share.

Comments are closed.

Exit mobile version