The 5 Most Useful Visual Studio Code Shortcuts

Visual Studio Code (also known as VS Code) is a popular free code editor that has a lot of features to make programming easier and more efficient.  Like many editors, it allows you to use keyboard shortcuts for some commands, so that you don’t have to take your hands off the keyboard to do common tasks.  Let’s take a look at five (5) of the most useful Visual Studio Code shortcuts! 

Note: these commands are written here with the “Ctrl” key, which works on Windows and Linux operating systems.  If you’re using VS Code for Mac, substitute the “Cmd” key instead! 

Visual Studio Code welcome screen on MacOS.

Ctrl + P

This shortcut opens the Quick Open dropdown, which allows you to quickly open files in your project. Just start typing the name of the file you want to open, and the editor will suggest matching files–when you find the one you want, hit the enter/return key to open it!

Ctrl + / 

This shortcut toggles commenting for the current line or selected code. You can use this shortcut to quickly add or remove comments from your code.

Ctrl + Shift + L

This shortcut selects all occurrences of any currently selected text in a file. You can use this shortcut to quickly edit multiple instances of the same text in your code.

Alt + Up/Down (Option + Up/Down on Mac)

This shortcut moves the current line of code up or down in the file. You can use this shortcut to rearrange your code without copying and pasting!


This shortcut jumps to the definition of the current symbol in your code. You can use this shortcut to quickly navigate to the definition of a function or variable, even if it’s in a different file.

Bonus: Ctrl + Shift + P

This shortcut opens the Command Palette dropdown, where you can search for and execute any command in Visual Studio Code. You can use this shortcut to quickly access any feature in the editor, without having to navigate through menus.  Just start typing to find the command you want!

These are just a handful of VSCode shortcuts–there are many, many more available, and you can even customize shortcuts to fit your needs.  I find myself reaching for these five the most often, so they might help you out, too! 

Add a Comment