Reset Visual Studio Code

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 →

Leave a Reply