This is all you need to know about VSCode shortcuts!

  • 06 December 2021
Post image

I thought I’d finally start programming, but I’m still writing about efficient operations. I tried hard to explain the obvious in my last article about VSCode and Vim bindings, but I hadn’t written just the basic operations of VSCode yet.

VSCode operations you need to know

The target of this article is very beginners. So I’m going to write about operations that you usually know (and use). Of course, not doing these operations will change your future cost by tens of hours. Many other VSCode shortcuts have been introduced on many sites, and you should definitely check them out, but what I’m going to introduce here are the essential, essential operations that every beginner should learn first.

Installing the code command

First of all, I often have to open folders and files in VSCode. If you are using Windows, you can use VSCode with WSL (if you don’t know what WSL is, I’ll write a separate article).

ctrlshiftp

type "wsl"

Select "Remote-WSL: New WSL Window" and start with WSL

VSCode

The code command seems to be installed by default.

commandshiftp

Type "shell"

Select "Shell Command: Install 'code' command in PATH" and install

VSCode

Open the folder with the code command

You can use the following command to open a folder or other file in VSCode.

code /prj/path/

VSCode
The first thing you need to remember are the following three things. If you have a large monitor, you can leave the sidebar and panels open, but you can also use them when you want to focus, so at least the following three are necessary.

Open and close the sidebar
ctrlb
Open Explorer (Focus)
ctrlshifte
Open and close the panel
ctrlj
Open and close the sidebar
commandb
Open and close the explorer
commandshifte
Open and close the panel
commandj

For those of you who don’t know what I’m talking about at this point.

As you can see below, you can hit commands anywhere without ever touching the mouse to make it run crisply and without stress. VSCode

It’s hard to understand this gif even though I’m smiling. I want to remember these actions because they are frequently repeated.


file-opening behavior

As shown above, I can focus on the explorer in the sidebar, select a file and enter to open it, but the actual project is often lined with so many files and directories that I don’t know instantly where to find the desired file.

ctrlp

Enter the first letter of the file name and select the file suggested.

Open and close the sidebar
commandp

Enter the first letter of the file name and select the file suggested.

VSCode

Other useful commands

Especially the command palette is crazy important. What it’s used for, see Google search “vscode command palette”!

Screen division
ctrl¥
command palette
ctrlshiftp
Screen division
command¥
command palette
commandshiftp

Basic operation system

Not just VSCode, but many other apps with the same command.

Open a new file
ctrln
Open a new window
ctrlshiftn
Search
ctrlf
Replace
ctrlh
Search in Project
ctrlshiftf
Open a new file
commandn
Open a new window
commandshiftn
Search
commandf
Replace
commandf
Search in Project
commandshiftf

What you should aim for

As I’ve already mentioned, the reason why I need to learn both Vim operations and Vscode shortcuts is to save tens or hundreds of hours of unproductive time in the future by reducing the number of operations I have to perform by even 0.n seconds. In addition, the mouse can be operated without touching it as much as possible, which means less hand movement and less stress.

These operations are hard at first, right? I understand. If you’re a beginner, you’ve probably been operating your PC with a mouse in your hand. Of course you need to use the mouse, and there are many things that are better done with the mouse, but the keyboard is by far the most efficient way to use the commands I’ve explained so far.

There are many more VSCode shortcuts and manipulation techniques that you can learn as soon as you can afford them. Are you ready? At the very least, you must learn and master the above operations. Absolutely!

You May Also Like