vscode 恢复默认设置:How to Reset Visual Studio Code to the Default Settings

Reset Visual Studio Code

  1. Restore Default Settings : 恢复 VSCode 初始的默认设置,即刚安装好时的状态。
  2. Uninstall All Extensions :卸载用户安装的所有扩展
  3. “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 

Borislav Hadzhiev

Last updated: Apr 6, 2024
Reading time·4 min

# Table of Contents

  1. Resetting specific settings in VS Code
  2. How to Reset all VS Code settings to the defaults
  3. Make sure to delete your .vscode/settings.json file as well
  4. Delete the contents of your settings.json file directly
  5. How to Uninstall or Disable Extensions in VS Code
  6. How to Reset your Keyboard Shortcuts in Visual Studio Code

# Resetting specific settings in VS Code

If you only need to reset specific settings:

  1. Press Ctrl + Shift + P (or Command + Shift + P on macOS).

Note: you can also press F1 to open the Command Palette.

  1. Type user settings and select Preferences: Open User Settings.

open user settings

You can also open the settings screen by pressing Ctrl + , on Windows and Linux or Cmd + , on macOS.

  1. Search for the setting you want to reset, e.g. cursor blinking.

  2. Click on the setting and then on the cogwheel icon and select Reset Setting.

reset specific 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.

use modified filter

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:

  1. Press Ctrl + Shift + P (or Command + Shift + P on macOS).

Note: you can also press F1 to open the Command Palette.

  1. Type user settings json.

  2. Click on Preferences: Open User Settings (JSON)

preferences open user settings

  1. Delete the contents of the file and add a set of curly braces {} as a replacement.

settings.json

{}

delete contents of settings json file

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.

  1. Press Ctrl + Shift + P (or Command + Shift + P on macOS).

Note: you can also press F1 to open the Command Palette.

  1. Type user settings and select Preferences: Open User Settings.

open user settings

You can also open the settings screen by pressing Ctrl + , on Windows and Linux or Cmd + , on macOS.

  1. Click on the Open Settings (JSON) icon in the top right corner.

click icon to open settings json

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.

delete contents of vscode settings json

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:

# 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

reset to default settings windows

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

reset settings using notepad

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:

# Additional Resources

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

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值