24 Best VSCode Keyboard Shortcuts for Coding Productivity (2024)
Visual Studio Code (VS Code) is the most popular and versatile code editor. Its powerful features make it an excellent development choice.
One key feature that sets VS Code apart is its extensive collection of keyboard shortcuts, which can greatly improve productivity and efficiency.
This article lists some of the most useful VS Code shortcuts that every developer should know.
Why should you use VSCode Keyboard Shortcuts?
Whether you are a beginner or an experienced developer, these shortcuts can significantly improve your coding experience.
By utilizing these shortcuts, you can save time navigating code and performing common tasks.
Here are some benefits of using these shortcuts in VS Code:
- Fast, efficient coding to speed up your workflow.
- Perform tasks quickly without manually going through menus.
- Reduce repetitive hand movements between the keyboard and mouse.
- Improve focus and concentration to level up your productivity.
- Customize your editing experience to suit your preferences.
Create your next presentation
snappify will help you to create
stunning presentations and videos.
24 Best VSCode Keyboard Shortcuts
Here are some important Visual Studio Code shortcuts you should know to become more productive in your coding.
Multiple Cursors
Multiple cursors allow you to simultaneously place more than one cursor at different locations within your code.
+ + Arrow Up or Down
It is particularly useful for performing repetitive tasks, such as making the same edit in different lines of code.
Command Palette
The Command Palette allows you to access and execute all the available commands.
+ Shift + P
You can use it to find and run any command without memorizing specific keyboard shortcuts, such as to search for symbols, install extensions, configure settings, etc.
Move A Line
This shortcut allows you to quickly move the selected line or lines of code up or down without cutting and pasting them.
+ Arrow Up or Down
You can rearrange code blocks, reorder lines, or organize your code structure easily.
Copy A Line
This shortcut is useful for duplicating selected lines of code.
Shift + + Up or Down
It allows you to copy the current line or selection and place it above or below the original line.
Toggle Sidebar
Sometimes, you want to view the full screen of your editor to focus solely on your code without distractions.
+ B
Use this command to hide or reveal the sidebar, allowing you to have more space for viewing and editing code when needed.
Toggle Terminal
The terminal is where you can run command-line tasks, execute scripts, and compile code within your editor.
+ ` (backtick)
This shortcut lets you quickly show or hide the terminal to free up space in the editor when you don't need to use it.
Open Multiple Terminals
This shortcut opens a new terminal tab, which is handy when you need to run multiple terminal commands simultaneously.
+ Shift + ` (backtick)
For example, you might want to run a dev server in one terminal tab while executing test commands in another.
Split View
Splitting the editor view is useful when working on multiple files or sections of code simultaneously.
+ \
While writing code, you can compare parts of the same file, edit multiple files side by side, or reference documentation.
Quick Open Files
You can search and open files simply by typing a few characters, and VS Code will filter the list of files to find the one you're looking for.
+ P
This is one of the most useful shortcuts for navigating large codebases quickly when you need to jump from one file to another.
Find A Symbol
It opens the Go to Symbol tool, which lists symbols in the current file for easy navigation and allows you to quickly find specific symbols, such as functions, classes, or properties, anywhere in your codebase.
+ Shift + O
Multiple Selections
It is useful for quickly making multiple edits to similar pieces of code or changing one string in many places.
+ D
Place the cursor on a word or a selection and use this shortcut to select the next occurrence of that word or selection.
You can also select multiple occurrences.
Switch Tabs
This VSCode keyboard shortcut is useful for swapping files opened in the editor.
+ PageUp or PageDown
You can easily move to your editor's next or previous open tabs without using the mouse.
Move Tabs
You can use this to rearrange the order of your tabs by moving the current editor tab to the left or right.
+ Shift + PageUp or PageDown
It provides an easy way to quickly organize tabs when you need to reposition a specific tab.
Go to Line
You can use this shortcut to navigate to a specific line in the file.
+ G
You can enter the line number you want to jump directly to that line in your file.
Comment Lines or Code Block
Adding or removing comments in the code is one of the most useful shortcuts.
+ /
Select the code block or line you want to comment on and press + /.
It's a quick and efficient way to add comments to your code or temporarily turn off code blocks for debugging or testing.
Format Document
This feature adjusts the format and indentation of the entire document according to the configured settings.
Shift + + F
You can keep your code clean and readable and easily spot errors by formatting your document.
Format Selection
It allows you to format only the selected text according to preconfigured settings.
+ K then + F
It's useful when you want to automatically format and adjust the indentation settings of a specific selection without affecting the entire document.
Rename Symbol
It is useful when working on a large file and changing the name of a class, function, or variable throughout the codebase.
F2
You can easily update all references to a symbol by renaming it, which helps to keep your code clear and organized.
Debug Test View
It launches the Run and Debug view, where you can configure, start, and manage a debugging session for your code to identify and fix errors.
+ Shift + D
Source Control View
With the Source Control view, you can work with Git repositories directly in your editor.
+ Shift + G
You can track and manage version control operations such as commit history, pull and push reviews, conflict resolution, and file change previews.
Show References
You can use this shortcut to search for all references of a symbol in your code.
Shift + F12
It will display a list of locations where the symbol is referenced so you can easily view and change it.
Find In Files
With this feature, you can search for a specific string or pattern within all files in your workspace to perform a global search and replace operation.
+ Shift + F
Scroll the Editor Vertically
It lets you quickly scroll up and down the screen without changing the cursor's position.
+ Arrow Up / Down
Select the Current Line
You can use it to select the current line of text where the cursor is positioned to copy, cut, or edit it.
+ L
Final Words
These shortcuts will help you focus and concentrate on your work without moving your fingers off your keyboard.
Use these VSCode keyboard shortcuts in your daily programming to save time and start coding like a pro.
If you like this article, you'll enjoy reading Best VSCode Themes.