Reset Visual Studio Code
- Restore Default Settings : 恢复 VSCode 初始的默认设置,即刚安装好时的状态。
- Uninstall All Extensions :卸载用户安装的所有扩展
- “Factory Reset” of Visual Studio Code : completely reset :删除 vscode 所有的配置、设置信息。
------------------------------------------------------------
关联参考:
vscode 清理缓存:Clearing the Visual Studio Code cache on Linux https://blog.csdn.net/ken2232/article/details/144359505
vscode 恢复默认设置:How to Reset Visual Studio Code to the Default Settings https://blog.csdn.net/ken2232/article/details/144359394
==================================
Reset Visual Studio Code Reset Visual Studio Code - ShellHacks
How to Reset Visual Studio Code to the Default Settings > https://bobbyhadz.com/blog/reset-vscode-to-default-settings
Reset Visual Studio Code
Posted on December 2, 2021by admin Reset Visual Studio Code - ShellHacks
There are several reasons why you may want to reset a Visual Studio Code (VSCode).
Probably your VSCode is sometimes acting weird and the reason of this is a bunch of settings and configurations that you’re not quite sure where they came from.
Or maybe your VSCode is extremely slow? May the poor performance be caused by some extensions?
In any case most of the issues can be solved by restoring the default settings, uninstalling extensions or by “factory reset” of the Visual Studio Code and in this note i will show how to do this.
Cool Tip: How to clone a Git repository in a Visual Studio Code! Read more →
Reset Visual Studio Code
Close the Visual Studio Code application before running the commands below.
Restore Default Settings
To restore the Visual Studio Code default settings it is simply required to empty the contents of the user’s settings.json
file, that can be easily done from the command line using the following commands:
# Windows Command Prompt
C:\> echo. > "%APPDATA%\Code\User\settings.json"
# Windows PowerShell
PS C:\> echo '' > "$env:APPDATA\Code\User\settings.json"
# macOS
$ echo > "$HOME/Library/Application Support/Code/User/settings.json"
# Linux
$ echo > "$HOME/.config/Code/User/settings.json"
Uninstall All Extensions
To completely delete all extensions from the Visual Studio Code, execute one of the commands below, depending on your operating system:
# Windows Command Prompt
C:\> echo y | rmdir /s "%USERPROFILE%\.vscode\extensions"
# Windows PowerShell
PS C:\> rm -r "$env:USERPROFILE\.vscode\extensions"
# macOS, Linux
$ rm -rf "$HOME/.vscode/extensions"
“Factory Reset” of Visual Studio Code
To completely reset the Visual Studio Code, execute:
# Windows Command Prompt
C:\> echo y | rmdir /s "%APPDATA%\Code"
C:\> echo y | rmdir /s "%USERPROFILE%\.vscode"
# Windows PowerShell
PS C:\> rm -r "$env:APPDATA\Code"
PS C:\> rm -r "$env:USERPROFILE\.vscode"
# macOS
$ rm -rf "$HOME/.vscode"
$ rm -rf "$HOME/Library/Application Support/Code"
$ rm -rf "$HOME/Library/Caches/com.microsoft.VSCode"
$ rm -rf "$HOME/Library/Saved Application State/com.microsoft.VSCode.savedState"
# Linux
$ rm -rf "$HOME/.vscode"
$ rm -rf "$HOME/.config/Code"
The commands above reset all the Visual Studio Code settings, completely uninstall/delete all extensions, clear caches, etc.
When you start the Visual Studio Code after running these commands, it will welcome you with a “Get Started with VS Code” message as if it has just been installed from scratch.
Cool Tip: How to select and edit multiple lines simultaneous in VSCode! Read more →
How to Reset Visual Studio Code to the Default Settings
> https://bobbyhadz.com/blog/reset-vscode-to-default-settings
Last updated: Apr 6, 2024
Reading time·4 min
# Table of Contents
- Resetting specific settings in VS Code
- How to Reset all VS Code settings to the defaults
- Make sure to delete your .vscode/settings.json file as well
- Delete the contents of your settings.json file directly
- How to Uninstall or Disable Extensions in VS Code
- How to Reset your Keyboard Shortcuts in Visual Studio Code
# Resetting specific settings in VS Code
If you only need to reset specific settings:
- Press
Ctrl
+Shift
+P
(orCommand
+Shift
+P
on macOS).
Note: you can also press F1
to open the Command Palette.
- Type user settings and select Preferences: Open User Settings.
You can also open the settings screen by pressing Ctrl
+ ,
on Windows and Linux or Cmd
+ ,
on macOS.
-
Search for the setting you want to reset, e.g. cursor blinking.
-
Click on the setting and then on the cogwheel icon and select Reset Setting.
Here is a short clip that demonstrates how this works.
You can repeat the steps to reset multiple specific settings.
If you only want to filter for the settings that you've modified, search for @modified
.
The @modified
filter will only render a list of the settings that you've modified.
Make sure to restart VS Code after resetting your settings.
# How to Reset all VS Code settings to the defaults
If you need to reset all VS Code settings to the defaults:
- Press
Ctrl
+Shift
+P
(orCommand
+Shift
+P
on macOS).
Note: you can also press F1
to open the Command Palette.
-
Type user settings json.
-
Click on Preferences: Open User Settings (JSON)
- Delete the contents of the file and add a set of curly braces
{}
as a replacement.
settings.json
{}
Once you delete everything between the curly braces {}
, your settings will be reset to the defaults.
You can also open your settings.json file in the following way.
- Press
Ctrl
+Shift
+P
(orCommand
+Shift
+P
on macOS).
Note: you can also press F1
to open the Command Palette.
- Type user settings and select Preferences: Open User Settings.
You can also open the settings screen by pressing Ctrl
+ ,
on Windows and Linux or Cmd
+ ,
on macOS.
- Click on the Open Settings (JSON) icon in the top right corner.
Once you open the file delete, everything between the curly braces and leave the file looking as follows.
settings.json
{}
Make sure to restart VS Code after resetting your settings.
# Make sure to delete your .vscode/settings.json file as well
Your project-specific configuration is stored in a .vscode/settings.json
file in the root directory of your project.
If you have ever edited settings with workspace mode active, this file will contain project-specific configuration that you also have to delete.
You can either delete the entire .vscode/settings.json
file or only leave an empty set of curly braces as shown in the screenshot.
.vscode/settings.json
{}
If you need to uninstall all extensions or reset your keyboard shortcuts as well, click on the following articles:
- How to Uninstall or Disable Extensions in VS Code
- How to Reset your Keyboard Shortcuts in Visual Studio Code
# Delete the contents of your settings.json file directly
You can also delete the contents of your settings.json
file directly.
Here are the paths to the settings.json
file depending on your operating system:
- on Windows:
%APPDATA%\Code\User\settings.json
. - on macOS:
$HOME/Library/Application\ Support/Code/User/settings.json
. - on Linux:
$HOME/.config/Code/User/settings.json
.
# On Windows
On Windows, start CMD and issue the following command.
cmd
# Windows code %APPDATA%\Code\User\settings.json
Once you open the file, set its contents to an empty set of curly braces {}
to reset it to the defaults.
settings.json
{}
You can also use the notepad
command to do the same.
cmd
# Windows notepad %APPDATA%\Code\User\settings.json
Make sure to restart VS Code after resetting your settings.
# On macOS
On macOS, open your shell and issue the following command.
shell
# macOS code $HOME/Library/Application\ Support/Code/User/settings.json
Set the contents of the file to an empty set of curly braces {}
and save it.
You can also use the gedit
command to do the same.
shell
# macOS gedit $HOME/Library/Application\ Support/Code/User/settings.json
# On Linux
On Linux, open your terminal and run the following command.
shell
# Linux code $HOME/.config/Code/User/settings.json
Set the contents of the file to an empty set of curly braces {}
and save it.
You can also use the gedit
command.
shell
# Linux gedit $HOME/.config/Code/User/settings.json
If you need to uninstall all extensions or reset your keyboard shortcuts as well, click on the following articles:
- How to Uninstall or Disable Extensions in VS Code
- How to Reset your Keyboard Shortcuts in Visual Studio Code
# Additional Resources
You can learn more about the related topics by checking out the following tutorials: