Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

Top VS Code Shortcuts for Mac and Windows

DZone 's Guide to

Top VS Code Shortcuts for Mac and Windows

Get results faster, work more efficiently with a few key strokes.

· Web Dev Zone ·
Free Resource

secret-passageway-in-book-case

Open doors you never have before with these shortcuts

In this article, you find some useful shortcuts for VS Code, which will help you to build or frame your programs. Shortcuts in programming are important, as they make life easier for developers — not to mention, at least to me, they feel like you're playing with your keyboard.

To use the shortcuts, you have to install some pluggings and VScode extensions to accelerate your program flow and have a great experience. 

You may also like: Visual Studio Code for Java: The Ultimate Guide.

Top VScode Shortcuts For macOS and Windows


1. Search Text in All Files at Once

This is my favorite feature of VScode. The ability to search any matching text everywhere all of your files in the project directory makes looking for files significantly easier while you're in a project. 

  • Shortcut for Mac: Control+shift+F.
  • Shortcut for Windows: Ctrl+Shift+F.

After using this shortcut, you will see a sidebar to your left. There, you can type any text that you want to search. This feature also helps to replace text ina directory.

2. Re-Open a Closed Editor

This can be used in a huge project when you are working on many files at the same time. It is quite frustrating while working like this and suddenly or mistakenly you close a tab and can't find it. VS Code has a shortcut that can come to your rescue

  • Shortcut for Mac and Windows: Ctrl+shift+T.

This command re-opens the closed editor so that you don’t have to search for it again and again from the menu.

3. Matching Text to Open Your File

This will help a developer to open his/her file by matching the text.

  • Shortcut for Mac and Windows: Ctrl+T.

It is one of my favorite features because you don’t need to manually click to a directory to re-open a file. Depending on your operating system and the version of VS Code you're running, you might have a Go-To Symbol in the file window when you type this command.

4. Select Everything (from Home to End)

This feature is used to select everything from top to bottom.

  • Shortcut for Mac and Windows: Control+shift+Home/End.

5. Delete the Previous Word

This shortcut is very useful in a situation where you make a typo or a long sentence and hate to press backspace to remove the text to delete the part you want. This command is used for that.

  • Shortcut for Mac: Control+delete.
  • Shortcut for Windows:Ctrl+backspace.

6. Select Text (Word-by-Word)

With this, you can easily select your text word-by-word.

  • Shortcut for macOS: Control+Shift+right arrow for the right side and Control+Shift+left arrow for the left.
  • Shortcut for Windows: Ctrl+shift+right arrow for right and Ctrl+Shift+Left Arrow for left side.

7. To Create a Duplicate Line

  • Shortcut for macOS: Control+shift+D
  • Shortcut for Windows: Ctrl+Shift+D

This feature allows you to make a duplicate line of any text.

8. Move From Beginning to End of a File

This is the quickest way to get or drag your cursor to the first or last line of a file.

  • For Mac: Control+Home to go to home and Control+End to go to the end.
  • For Windows: Ctrl+home to go to home and Ctrl+End to go to the end.

9. Deleting a Line

There are two ways to delete a line:

Overwriting the clipboard:

  • For Mac: Control+X.
  • For Windows: Ctrl+X.

Preserving the clipboard:

  • For Mac: Control+Shift+K.
  • For Windows: Ctrl+Shift+K.

As above, there are top VScode shortcuts for both macOS and Windows users which help them to develop and work to create amazing applications.

[Important] In VScode there are every shortcut work similar, the basic difference is just in Ctrl and command because macOS and Windows had different keyboard pattern.

Additional Shortcuts for Mac

Now, here some more shortcuts that are useful for macOS users.

General commands for mac
Basic editing commands for Mac
Navigation and editor management Commands for Mac
Search and replace Commands for Mac
Rich language editing Commands for Mac
Display Commands for Mac
Debugging and Integrated Terminal Commands for Mac

Additional Shortcuts for Windows

General Commands for Windows
Basic Editing Commands for Windows
Search and replace and multi-cursor selection commands for Windows
Rich language editing Commands for Windows
Display Commands for Windows

Related Articles

Topics:
web dev ,visual studio ,mac ,windows ,shortcuts ,tutorial

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}