My Top 10 VS Code Shortcuts for Productivity
Published: 2023-11-17 13:33:50


![Photo by [Godfrey Nyangechi](https://unsplash.com/@atimagodie?utm_source=medium&utm_medium=referral) on [Unsplash](https://unsplash.com?utm_source=medium&utm_medium=referral)](https://cdn-images-1.medium.com/max/12000/0*aKyvvJiA_cNRldmb)

## Introduction

VS Code is without a shadow of a doubt one of the most popular IDEs loved by developers. Its lightweight nature and many extensions make it one of my favorite editors. I have been using VS Code for a while and I wanted to share some of my favorite shortcuts that I regularly use for productivity.

Some people argue that you shouldn’t even use the mouse while coding. That’s the ultimate goal and if you’re interested in doing that you should probably use something like [neovim](https://neovim.io/). In fact, the neovim people think VS Code is for newbies. I haven’t tried neovim yet and it’s something I would like to try but I think VS Code can be a productive tool if used properly.

![neovim vs vscode](https://cdn-images-1.medium.com/max/2000/1*OM4dTujf8PMSw9-e-UbWpQ.png)

I will list my top 10 VS Code shortcuts I’ve come to use in my day-to-day life.

## 1. Navigate to the left/right tabs on the editor

When you have so many editor tabs open it becomes handy to navigate left/right without using your mouse.

* **macOS**: ⌘ ⌥ ← / ⌘ ⌥ →

* **Linux**: Ctrl + [PgUp/PgDn]

* **Windows**: Ctrl + [PgUp/PgDn]

![Navigate to the left/right tabs](https://cdn-images-1.medium.com/max/3840/1*xJTLdHCUJk4bUkoBspCEGw.gif)

## 2. Show Integrated Terminal

This is a very simple but effective shortcut you can use to easily open or close the integrated IDE of the terminal. It is handy when you want to open your terminal and execute some commands quickly.

* **macOS**: ⌃`

* **Linux**: Ctrl + `

* **Windows**: Ctrl + `

![Show/hide terminal](https://cdn-images-1.medium.com/max/3840/1*C82k8W4HO0j8WmoHy9NVRA.gif)

## 3. Bracket Matching

Brackets come in pairs and we often want to know where one bracket starts and where it ends. You can use this shortcut to see the opening and closing brackets. Just make sure your cursor is near either the opening or closing bracket.

* **macOS**: ⇧⌘\

* **Linux**: Ctrl + Shift + \

* **Windows**: Ctrl + Shift + \

![Matching brackets will be highlighted as soon as the cursor is near one of them](https://cdn-images-1.medium.com/max/3840/1*oMri1MI6DNPNtUA40L5qjQ.gif)

## 4. Navigate Back To Your Previous Position

When working on a file with hundreds of lines of code, we often jump from one position to another to understand something. Say, for example, from line 900 to 500. After looking at the code, you often want to return to your previous position. Instead of wasting time scrolling the file with your mouse, use this shortcut instead.

* **macOS**: ⌃-

* **Linux**: Ctrl + Alt + -

* **Windows**: Alt+ ←

![Go back](https://cdn-images-1.medium.com/max/3840/1*-02uh9oIZxh-lZjEdLZFdw.gif)

## 5. Navigate To The Start/End of Current Word

You can use this simple shortcut to move your cursor to either the left or right of the current word.

* **macOS**: ⌥ + [← / →]

* **Linux**: Ctrl + c

* **Windows**: Ctrl + [← / →]

![Navigate to the start/end of the current word](https://cdn-images-1.medium.com/max/3840/1*iXkSFV_1BCeIZfL3-G84dw.gif)

## 6. Select Multiple Occurrences Of The Same Word

Let’s say you have some variable called *count* and you want to select all the occurrences of the word one by one. You can use this shortcut to select all the occurrences one by one.

* **macOS**: ⌘D

* **Linux**: Ctrl + D

* **Windows**: Ctrl + D

![Select all cents variables](https://cdn-images-1.medium.com/max/3840/1*jiRsjm1GJEQzwftZqxLRng.gif)

## 7. Move Line Up/Down

You can use this shortcut to move an entire line of code up/down without using cut and paste.

* **macOS**: ⌥↓ / ⌥↑

* **Linux**: Alt + [↑ / ↓]

* **Windows**: Alt + [↑ / ↓]

![Move a line of code up/down](https://cdn-images-1.medium.com/max/3840/1*asjhbpreG_j-LztoucZERg.gif)

## 8. Show Search

VS Code is very good at indexing the files inside a directory when you open an entire workspace. As a result, it can do a very good job of searching for words across many different files. I often use this shortcut when I’m looking for some word and I don’t know which file has this word. You can simply open the search explorer using this shortcut.

* **macOS**: ⇧⌘F

* **Linux**: Ctrl + Shift + F

* **Windows**: Ctrl + Shift + F

![Show search explorer](https://cdn-images-1.medium.com/max/3840/1*ztq4tyuZl4OhPSJFfP5i6g.gif)

## 9. Toggle line comment

This is also another simple but very good shortcut. We often want to quickly comment and uncomment a line of code inside a file.

* **macOS**: ⌘/

* **Linux**: Ctrl + /

* **Windows**: Ctrl + /

![Toggle comment](https://cdn-images-1.medium.com/max/3840/1*bBf2ltNjAVIzX_s00gBJAw.gif)

## 10. Close Editor Window

Let’s say you are done working with the current open editor tab and you want to close it. Then you can use this very simple but very simple shortcut to close the open editor tab.

* **macOS**: ⌘W

* **Linux**: Ctrl + W

* **Windows**: Ctrl + W

![Close editor tab](https://cdn-images-1.medium.com/max/3840/1*9aojvwZuYLChNaFAK_3MOA.gif)

## Conclusion

I hope you’ve learned something new from this article. Let me know your favorite shortcuts in the comment section. Here’s an official cheat sheet of vs code shortcuts:

* Windows: [https://code.visualstudio.com/shortcuts/keyboard-shortcuts-windows.pdf](https://code.visualstudio.com/shortcuts/keyboard-shortcuts-windows.pdf)

* macOS: [https://code.visualstudio.com/shortcuts/keyboard-shortcuts-macos.pdf](https://code.visualstudio.com/shortcuts/keyboard-shortcuts-macos.pdf)

* Linux: [https://code.visualstudio.com/shortcuts/keyboard-shortcuts-linux.pdf](https://code.visualstudio.com/shortcuts/keyboard-shortcuts-linux.pdf)