7 Visual Studio Code Shortcuts To Make Your Life Easier

Kevin Rodríguez
4 min readFeb 23, 2020

--

Keyboard shortcuts are a great way to save time when doing simple tasks like repeating an action in Excel or flipping an image in Photoshop, almost every application has its own shortcuts.

Today I’ll show you seven Visual Studio Code shortcuts that you can use to code faster.

Photo by Juan Gomez on Unsplash

I’ve noticed that many people I’ve worked with don’t use shortcuts in their IDEs or code editors, and I thought that would be a good idea to share the ones I use the most, in my favorite code editor, Visual Studio Code.

Without further ado, let’s begin:

Open a file in the project

I’ll start with a very basic yet powerful one, opening a file. It’s very frustrating when you spend time going over hundreds of files to open a particular file. Well, with this shortcut you can open a file from anywhere in the editor by typing its name or a part of it.

In Windows/Linux: Ctrl + P

In macOS: cmd + P

Show command search

Have you spent time looking for an specific setting or firing some extension? What if you could just type the action and let the editor take you to that section or fire an action? That’s what this shortcut is about, a search bar will open and you can just type what you want to do or find.

In Windows/Linux: Ctrl + Shift + P

In macOS: cmd + Shift+ P

Search text in the project

This shortcut will take you to the Search section of VS Code without taking your hands from the keyboard.

In Windows/Linux: Ctrl + Shift + F

In macOS: cmd + Shift+ F

Toggle word wrapping

Sometimes our lines of code can become a little long (especially because of the indentation or long text) and it’s very stressful to scroll horizontally or having to move with the keyboard to keep seeing the code. Fortunately, VS Code has this covered, we can enable word wrapping to automatically have a line break whenever the code reaches the right end of the screen.

In Windows/Linux: Alt + Z

In macOS: option + Z

Rename a symbol

Sometimes we have to rename variables, functions, objects and more, and we usually spend a lot of time doing it manually. Maybe you have tried find and replace for doing this, but sometimes you have that name on a string for example and it gets changed as well, and we don’t want that. Renaming things is easy with this shortcut, and its greatest power is that it changes the name where it’s referenced as well (even if it’s in another file).

Note: you don’t need to select the text, just put the cursor over it.

In Windows/Linux/macOS: F2

Select text ocurrences

Sometimes we don’t want to rename all the ocurrences of a text or maybe we want to rename a part of it. That’s where this shortcut comes in. Just press it as many times as you want to select every ocurrence of a text one by one.

In Windows/Linux: Ctrl + D

In macOS: cmd + D

Toggle built-in terminal

In case you don’t know, VS Code has a built-in terminal. We can show it and hide it with this shortcut.

In Windows/Linux: Ctrl + `

In macOS: control + `

I hope you find it helpful and I encourage you to check out more VS Code shortcuts for macOS here and for Windows/Linux here.

--

--