Back
Blog post cover

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:

Create your next presentation

snappify will help you to create
stunning presentations and videos.

Get started - It's free

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

Using multiple cursors in VSCode

Multiple cursors allow you to simultaneously place more than one cursor at different locations within your code.

  Ctrl +   Alt + 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.

  Ctrl + 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.

  Alt + Arrow Up or Down

You can rearrange code blocks, reorder lines, or organize your code structure easily.

Copy A Line

Copy a line VSCode keyboard shortcut

This shortcut is useful for duplicating selected lines of code.

Shift +   Alt + 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.

  Ctrl + 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.

  Ctrl + ` (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

Open multiple Terminals in VSCode

This shortcut opens a new terminal tab, which is handy when you need to run multiple terminal commands simultaneously.

  Ctrl + 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.

  Ctrl + \

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.

  Ctrl + 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.

  Ctrl + Shift + O

Multiple Selections

It is useful for quickly making multiple edits to similar pieces of code or changing one string in many places.

  Ctrl + 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.

  Ctrl + 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.

  Ctrl + Shift + PageUp or PageDown

It provides an easy way to quickly organize tabs when you need to reposition a specific tab.

Go to Line

Go to a specific line in VSCode

You can use this shortcut to navigate to a specific line in the file.

  Ctrl + 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.

  Ctrl + /

Select the code block or line you want to comment on and press   Ctrl + /.

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 +   Alt + 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.

  Ctrl + K then   Ctrl + 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.

  Ctrl + Shift + D

Source Control View

Source Control Panel View

With the Source Control view, you can work with Git repositories directly in your editor.

  Ctrl + 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.

  Ctrl + Shift + F

Scroll the Editor Vertically

It lets you quickly scroll up and down the screen without changing the cursor’s position.

  Ctrl + 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.

  Ctrl + 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.

FAQs:

How do I get Keyboard Shortcuts in VS Code?

You can access Keyboard Shortcuts in VS Code by pressing   Ctrl + K, then   Ctrl + S.

How do I add Keyboard Shortcuts to VS Code?

To add keyboard shortcuts to VS Code, open the command palette (   Ctrl + Shift + P), type “Preferences: Open keyboard shortcuts,” and customize shortcuts in the keybindings.json file.

How to reset VS Code keyboard shortcuts?

To reset shortcuts, open the Keyboard Shortcuts panel, click on the three dots, and select “Reset Keybindings”.

Share Article