VS Code shortcuts, or why you write code slowly

Ali Toshmatov
3 min readMar 8, 2021

As a programmer, you should master a bunch of skill sets in order to increase your performance and productivity. Choosing the right code editor can also impact hugely on your coding experience, and knowing your editor well is essential. If you were lucky to choose vs code then this article might be beneficial to you. I have listed some popular keyboard shortcuts below which I use very often and helps me a lot in completing my task faster.

Searches

ctrl + P is used to search for files in the root directory opened in VS Code.

ctrl + F is used for searching a string in the current file. All found results will be highlighted in the editor and you can move one to another by pressing ENTER. You can also hold down ALT and press ENTER to select all results at the same time, it is most helpful when you want to change the same words at the same time.

Searching for strings in file

ctrl + H is also used for the same purpose as mentioned earlier, it helps to replace a group of the same strings with other strings.

replacing all same strings with other strings

ctrl + D this one is my favorite. This shortcut helps you to find matches of the same strings, you can select a fragment of string and while holding down the ctrl button you can press D to select every next match or just press this buttons even you have not selected any string it will work as long as the cursor is next to some string.

selecting same strings in vs code

Copy/Paste

ctrl+C well this one might look simple but for those who don’t know it might make a huge difference. We all know that combination of these keys copies selected string but in VS Code if you are not selected any string, it copies the whole line. And you can paste that line of code wherever you want.

Copying line in vs code

shift/ctrl. Sometimes selecting a code fragment or moving a cursor using a mouse can be painful or you just don’t want to take your hands off from the keyboard. While pressing down the ctrl button you can move the cursor much faster jumping over words. Or if you want to select some fragment you can do it by pressing down the shift key and moving your cursor around. You can also use these two keys together to select fragments while quickly jumping over words.

alt + ↑/↓ using these shortcuts you can move lines of your code between other lines. You can either select specific lines or just move a single line.

There are still many useful shortcuts in VS Code. I am going to keep updating this article and add new tips. If you have any good suggestions related to keyboard shortcuts, you can leave comments mentioning them and I would be happy to include them too.

--

--