简体   繁体   中英

How to reset settings in Visual Studio Code?

It's a simple thing and I was pretty sure it's well described, but surprisingly it is not so obvious.

Here I've found a detailed description of settings file. As it states it should be setting.json file located %APPDATA%\Code\User\settings.json , but in my case it's not there.

Can someone give me some help with restoring default settings in Visual Studio Code? I've hidden menu bar by accident and I can't find no way to show it back.

You can get your menu back by pressing/holding alt , you can then toggle the menu back on via the View menu.

As for your settings, you can open your user settings through the command palette:

  1. Press F1
  2. Type user settings
  3. Press enter
  4. Click the "sheet" icon to open the settings.json file:

    在此处输入图像描述

From there you can delete the file's contents and save to reset your settings.


For a more manual route, the settings files are located in the following locations :

  • Windows %APPDATA%\Code\User\settings.json
  • macOS $HOME/Library/Application Support/Code/User/settings.json
  • Linux $HOME/.config/Code/User/settings.json

Extensions are located in the following locations :

  • Windows %USERPROFILE%\.vscode\extensions
  • macOS ~/.vscode/extensions
  • Linux ~/.vscode/extensions

If you want to reset everything, go to %userprofile%\AppData\Roaming\Code and delete the whole folder after you uninstall the VS code, then install it again.

Also in %userprofile%\.vscode delete extensions folder in case you want to delete all extensions.

This may be overkill, but it seemed to work for me (on a Mac):

#!/bin/sh

rm -rfv "$HOME/.vscode"
rm -rfv "$HOME/Library/Application Support/Code"
rm -rfv "$HOME/Library/Caches/com.microsoft.VSCode"
rm -rfv "$HOME/Library/Saved Application State/com.microsoft.VSCode.savedState"

After I ran that, and restarted VSC, it showed the the "Welcome" screen, which I took to mean that it was starting from scratch.

If you want to start afresh, deleting the settings.json file from your user's profile will do the trick.

But if you don't want to reset everything, it is still possible through settings menu.

设置菜单

You can search for the setting that you want to revert back using search box.

You will see some settings with the left blue line , it means you've modified that one.

搜索设置

If you take your cursor to that setting, a gear button will appear. You can click this to restore that setting.

齿轮按钮

You can also use the drop-down below that setting and change it to default.

设置下拉

在 Linux 环境中,删除文件夹“~/.config/Code”以重置 Visual Studio Code 设置。

You can reset both the user and workspace settings in VS Code as shown in the following screenshots

在此处输入图像描述

在此处输入图像描述

在此处输入图像描述

在此处输入图像描述

在此处输入图像描述

  1. Go to Menu Bar . Click on File -> Preferences -> Settings 在此处输入图像描述
  2. On the top right corner of the Settings tab, click on the 3 dots button ... -> Show Modified Settings 在此处输入图像描述
  3. You can now reset all the modified settings individually在此处输入图像描述

Steps to reset on Windows:

  • Press 'Windows-Key"+R , and enter %APPDATA%\Code\User

    在此处输入图像描述

    And delete 'setting.json' at this location.

  • Press 'Windows-Key"+R , and enter %USERPROFILE%\.vscode\extensions

    在此处输入图像描述

    And delete all the extensions there.

EDIT

After two vote downs added images to make it more clear :)

Go to File -> preferences -> settings.

On the right panel you will see all customized user settings so you can remove the ones you want to reset. On doing so the default settings mentioned in left pane will become active instantly.

The best easiest way I found to reset settings:

Open Settings page ( Ctrl + Shift + P ):

在此处输入图像描述

Go onto your desire setting section to reset, click on icon and then Reset Setting :

在此处输入图像描述

If all you want to do is "reset perspective" ala Eclipse (and why is this not in Code anyway?) then select [View] -> [Open View] -> [Run and Debug].

This puts all the panes back, this is what most people mean by "reset perspective".

注意,如果清除设置不能解决您的问题,您可能还需要卸载扩展程序。

If you just need to reset your profile for a quick test, VSCode 1.71 (Aug. 2022) will propose:

transient profiles

These profiles are deleted automatically once the last window which uses it is closed.

You can create and associate a transient profile from

  • CLI by passing --profile-transient flag. Eg:

     code <folder-uri> --profile-transient
  • UI from Command Palette using command Create Transient Settings Profile

These will create a transient settings profile and associate it to the workspace.
Once the workspace is closed (or uses different profile) this profile is deleted.

That can help before going nuclear and deleting your current profile and VSCode settings .

This is released to VSCode Insiders today.

To reset the default settings I'm not sure, but if you're just trying to get a menu bar back then try right clicking on the anywhere on the toolbar area and clicking the toolbar you need.

EDIT:
Figured out how to reset the settings Click on the tools button on the top, click "Import and Export Settings" and then click "Reset All Settings". Then go through the wizard from there.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM