How to Reset your Keyboard Shortcuts in Visual Studio Code

avatar
Borislav Hadzhiev

Last updated: Apr 6, 2024
4 min

banner

# Table of Contents

  1. Reset specific keyboard shortcuts in VS Code
  2. Reset all Keyboard shortcuts in VS Code
  3. Resetting your keybindings.json file directly

# Reset specific keyboard shortcuts in VS Code

If you need to reset specific keyboard shortcuts in VS Code:

  1. Press:
  • Ctrl + Shift + P on Windows and Linux.
  • Command + Shift + P on macOS.
Note: you can also press F1 to open the Command Palette.
  1. Type Keyboard Shortcuts and select Preferences: Open Keyboard Shortcuts.

preferences open keyboard shortcuts

  1. Click on the three dots (ellipsis) icon at the top right corner and select Show User Keybindings.

click three dots show user keybindings

When the filter is applied, only keyboard shortcuts that you have modified are shown.

You can also apply the filter by typing @source:user into the search field.

  1. Right-click on the keyboard shortcuts you want to reset and select Reset Keybinding.

right click reset keybinding

You can repeat the process for any of the user-defined keyboard shortcuts you want to reset.

If you completely want to remove a keyboard shortcut from VS Code, you would right-click on it and select Remove Keybinding.

right click remove keybinding

# Reset all Keyboard shortcuts in VS Code

If you need to reset all keyboard shortcuts to the default:

  1. Press:
  • Ctrl + Shift + P on Windows and Linux.
  • Command + Shift + P on macOS.
Note: you can also press F1 to open the Command Palette.
  1. Type Keyboard Shortcuts and select Preferences: Open Keyboard Shortcuts.

preferences open keyboard shortcuts

  1. Click on the Open Keyboard Shortcuts (JSON) icon to the left.

open keyboard shortcuts

  1. Delete all the contents of the keybindings.json file, leaving just a set of square brackets [].
keybindings.json
[]

reset all keyboard shortcuts

If you only leave a set of square brackets [] in your keybindings.json file, all user-defined keyboard shortcuts are reset.

You can view the default keyboard shortcuts in 2 ways:

  • using the UI
  • using your Default Keybindings file

For example, if you want to use the UI:

  1. Press:
  • Ctrl + Shift + P on Windows and Linux.
  • Command + Shift + P on macOS.
Note: you can also press F1 to open the Command Palette.
  1. Type Keyboard Shortcuts and select Preferences: Open Keyboard Shortcuts.

preferences open keyboard shortcuts

  1. Search for a specific keyboard shortcut based on the name of the command or click on the Record Keys button to search based on a key combination.

click to record keys

You can also view the default keyboard shortcuts a JSON format.

  1. Press:
  • Ctrl + Shift + P on Windows and Linux.
  • Command + Shift + P on macOS.
Note: you can also press F1 to open the Command Palette.
  1. Type Default keyboard and select Preferences: Open Default Keyboard Shortcuts (JSON).

default keyboard shortcuts

Your Default Keybindings file contains an array of objects where each object is a default keyboard shortcut.

# Resetting your keybindings.json file directly

An alternative approach is to directly reset your keybindings.json file by editing it and setting its contents to a set of square brackets [] or removing specific keybinding objects.

Depending on your operating system, the file is located under:

  • on Windows: %UserProfile%\AppData\Roaming\Code\User\keybindings.json
  • on macOS: ~/Library/Application\ Support/Code/User/keybindings.json
  • on Linux: $HOME/.config/Code/User/keybindings.json

On Windows, issue the following command in CMD to open the file in Notepad.

cmd
# Windows notepad "%UserProfile%\AppData\Roaming\Code\User\keybindings.json"

open keyboard shortcuts file windows

If the file doesn't exist, then you don't have any user-defined keyboard shortcuts.

Once you open the file, you can set it to a set of square brackets [] if you want to reset all keyboard shortcuts.

You can also use the code command to open the file in VS Code.

cmd
# Windows code "%UserProfile%\AppData\Roaming\Code\User\keybindings.json"

If you only want to reset specific keyboard shortcuts, remove the corresponding objects from the array.

On macOS, you can use the gedit command to open the file from your terminal (e.g. bash or zsh).

shell
# macOS gedit "~/Library/Application\ Support/Code/User/keybindings.json"

You can also open the file n VS Code on mac.

shell
# macOS code "~/Library/Application\ Support/Code/User/keybindings.json"

You can also use gedit to open the keybindings.json file from your terminal on Linux.

shell
# Linux gedit "$HOME/.config/Code/User/keybindings.json"

open keyboard shortcuts file linux

If you need to completely reset your keyboard shortcuts, leave an empty set of square brackets [] in the file.

You can also open the file in VS Code.

shell
# Linux code "$HOME/.config/Code/User/keybindings.json"

If you need to Reset VS Code to the default settings or uninstall all extensions as well, click on the following articles:

# Additional Resources

You can learn more about the related topics by checking out the following tutorials:

I wrote a book in which I share everything I know about how to become a better, more efficient programmer.
book cover
You can use the search field on my Home Page to filter through all of my articles.