Top 10 VScode Shortcuts For Mac and Windows to Help You be More Productive

Top 10 VScode Shortcuts For Mac and Windows to Help You be More Productive

Written by Bobby Iliev on Oct 27th, 2020 Views Report Post

Introduction

I have been using VScode for a while now, and I can say that it is my favorite IDE so far!

In this post, I will show you my top 10 VSCode shortcuts, which could help you be more productive!

Prerequisites

Before you get started, you will need to have VScode installed.

If you don't have it, you can follow the steps on how to do that here:

https://code.visualstudio.com/download

1. Multi-cursor

Being able to edit multiple lines at once is super handy. To do that in VScode you just need to click on a specific line and then press the following to select the lines bellow or above:

  • Windows:
Ctrl+Alt+ ↑ / ↓ 
  • Mac:
⌥⌘↑ / ↓ 

Example:

Select multiple lines at once

2. Hide and show your sidebar

To quickly hide and show your VScode sidebar you need to use the following:

  • Windows:
CTRL+B
  • Mac:
⌘B

Example:

VScode shortcut open sidebar

As a side note, you could use the same for your Chrome browser to show and hide your bookmarks.

3. Re-open a Closed Tab

Isn't it anoying when you accidently close a tab and then you need to search for the file and open it again? In order to open the last closed tabl in VScode you just need to use the following:

  • Windows:
CTRL+SHIFT+T
  • Mac:
CTRL+SHIFT+T

Example:

VScode shortcut

Again you can use the same combination for your browser as well!

4. Delete a whole line

Rather than marking and then deleting the line, what you could do is use the following in order to do so:

  • Windows:
CTRL+SHIF+K
  • Mac:
⇧⌘K

Example:

Delte whole line in VScode

5. Search and replace

Rather than manually chaning all references of a specific string you can use this quick way to do a search and replace instead.

  • Windows:
CTRL+H
  • Mac:
⌥⌘F

VScode search and replace

6. Duplicating a line

Rather thank coping and pasting the same line a few times, there is an easier way to duplicate a line in VScode!

To do so just do the following:

  • Windows:
CTRL+SHIFT+D
  • Mac:
⌘+SHIFT+D

Example:

Duplicate line in VScode

7. Enable/Disable word wrap

This is probably my personal favourite one. By enabling word wrap VScode breaks the section of your code into lines so that it will fit into the screen.

  • Windows:
ALT+Z
  • Mac:
⌥Z

Example:

Enable Word Wrap VSCode shortcut

8. Open a new file

Just like in many other editors, you could use the following in order to open a new file:

  • Windows:
CTRL+N
  • Mac:
⌘N

Example:

New file VScode shortcut

9. Split Editor

Splitting your editor into multiple windows could be a very handy feature in case that you want to edit multiple files side by side.

To do that in VScode just use:

  • Windows:
CTRL+\
  • Mac:
⌘\

Example:

VScode short cuts

10. Go to matching bracket

This is a very handy short cut whenever you are trying to find which is the next closing bracket.

  • Windows:
Ctrl+Shift+\
  • Mac:
⇧⌘\

Example:

VScode short cuts

Conclusion

You can find a full list of all available shortcuts here:

If you are just getting started with VScode and Laravel, I would recommend checking out this post here on 8 Awesome VS Code Extensions for Laravel Developers

I hope that this helps!

Comments (0)