150+ VS Code Shortcut Keys (PDF Download)

If you are a developer who uses Visual Studio Code (VS Code) for coding, knowing VS Code shortcut keys is essential. Using these shortcuts can boost your coding speed and make your work significantly easier.
Whether you are working with languages like HTML, Python, Java, or React JS, VS Code is widely used across the board, and these shortcuts can prove to be extremely useful.
In this article, we provide a detailed overview of VS Code shortcut keys. We are sharing the complete list and explaining how you can use these shortcuts to make your development workflow much easier.
VS Code Shortcut Keys List
Visual Studio Code (VS Code) continues to be the most popular code editor for developers worldwide. Let’s look at a list of some basic and useful VS Code shortcut keys that work on Windows, Mac, and Linux.
Basic VS Code Shortcut Keys
- Ctrl + P – To quickly open any file
- Ctrl + Shift + P – To open the Command Palette
- Ctrl + B – To toggle the sidebar
- Ctrl +
/– To comment/uncomment a line - Ctrl + K, Ctrl + C – To comment a line
- Ctrl + K, Ctrl + U – To remove a comment
- Alt + Arrow Up/Down – To shift a line up or down
- Ctrl + D – To select a specific word
- Ctrl + Shift + L – To select all occurrences of the same word
- Ctrl + Shift + K – To delete a line
VS Code Shortcut Keys for HTML
- ! + Tab – To generate the basic HTML5 template.
- Ctrl + Shift + A – To wrap HTML tags.
- Alt + Shift + F – To format HTML.
VS Code Shortcut Keys for Python
- F5 – To run the Python code.
- Shift + Alt + F – To format the code.
- Ctrl + K, Ctrl + F – To format the selected code.
VS Code Shortcut Keys for Java
- Ctrl + Shift + O – To automatically import missing imports.
- F5 – To run the Java program in debug mode.
- Alt + Shift + F – To format the code.
Shortcut Keys for React JS in VS Code
- Ctrl + Shift + P – To quickly generate React components using ES7 snippets extensions.
- Ctrl + Shift + D – To duplicate a line.
- Alt + Shift + Down/Up – To move a line up or down.
VS Code Shortcut Keys Mac, Windows, Linux
In VS Code, you can use shortcuts tailored to your platform. Let’s look at some key VS Code shortcuts for Mac, Windows, and Ubuntu –
VS Code Shortcut Keys for Mac
- Command + P – to search for files.
- Command + B – to toggle the sidebar.
- Command + Shift + P – to open the Command Palette.
VS Code Shortcut Keys for Windows
- Ctrl + Shift + P – To view all commands.
- Ctrl + Shift + N – To open a new window.
- Ctrl + Shift + F – To use the search function.
VS Code Shortcut Keys for Ubuntu/Linux
- Ctrl + Shift + X – to access the extensions marketplace.
- Ctrl + K, Ctrl + 0 – to collapse all folders.
- Ctrl + Shift + F – to search within the project.
How to change VS Code shortcut keys?
If you feel that the default shortcuts aren’t working for you, you can customize them. You can easily change the shortcuts within VS Code.
- Go to File > Preferences > Keyboard Shortcuts.
- Find the shortcut you want to change and assign a new keyboard shortcut.
If you want to restore all shortcuts, you can also use the ‘Reset Keybindings’ option.
Conclusion
Mastering VS Code shortcuts can save you time and effort when working on projects. These VS Code keyboard shortcuts for Linux, Windows, and macOS.
FAQs About VS Code Shortcuts
What does Ctrl P do in VS Code?
In VS Code, pressing Ctrl + P (or Command + P on macOS) opens the “Quick Open” feature.
What does F12 do in VS Code?
In VS Code, pressing the F12 key is a keyboard shortcut used to trigger the “Go to Definition” action.







