165

I need to do a clean installation of VS Code on my mac.

I opened the terminal and removed the .vscode/ from ~. I also deleted the Visual Studio Code.app/ from /. However, after deleting all that and downloading a fresh copy, I installed and open the editor and the editor remembered the last project I had. For me, that means that it is something else I need to delete but I can't find it. I went to the documentation but can't find anything about uninstalling the editor.

Does anyone know how to completely uninstall VSCode from mac?

What I have tried

Following these instructions and doing a new installation of VS Code, but it still keeps remembering the last project I opened.

https://developer.xamarin.com/guides/cross-platform/getting_started/installation/uninstalling_xamarin/#Using_the_Uninstall_Script

Gino Mempin
  • 25,369
  • 29
  • 96
  • 135
redeemefy
  • 4,521
  • 6
  • 36
  • 51

8 Answers8

315

Here are all the places where VSCode stores stuff on Mac OS X, besides the Visual Studio Code.app itself, which is in your Applications folder:

rm -fr ~/Library/Preferences/com.microsoft.VSCode.helper.plist 
rm -fr ~/Library/Preferences/com.microsoft.VSCode.plist 
rm -fr ~/Library/Caches/com.microsoft.VSCode
rm -fr ~/Library/Caches/com.microsoft.VSCode.ShipIt/
rm -fr ~/Library/Application\ Support/Code/
rm -fr ~/Library/Saved\ Application\ State/com.microsoft.VSCode.savedState/
rm -fr ~/.vscode/

Update (Feb 2020): There are potentially also hidden extension directories in your home directories. To get rid of everything make sure you look for those too. They start with .vscode-.

Please run this command with care. Maybe you want to keep extension directories.

rm -rf ~/.vscode*
j7nn7k
  • 17,995
  • 19
  • 78
  • 88
  • 2
    I am using 1.36.1 ad syntax highlighting suddenly stopped working for no reason. I used this to reset my VS Code to default settings without uninstalling and syntax highlighting is back – mujtaba_ahmad Jul 17 '19 at 04:07
  • 1
    I see another folder not listed above. It's called `.vscode-oss`. I found it under `Users/your-user-name`. – tonkatata Feb 01 '20 at 22:28
  • 1
    You have a point. I don't have that particular folder, but oder folders related so extensions of some sorts ( `.vscode-cpptools/ ` `.vscode-react-native/ ` in my case) – j7nn7k Feb 03 '20 at 07:28
  • 1
    This is the best answer. Combine this with a 3rd-party app uninstaller, and you are set. – Devin Rhode Sep 01 '20 at 00:04
  • I was having so much frustration with getting Omnisharp to work after it suddenly stopped functioning. After a couple weeks of searching, trying things, and complaining to the Omnisharp devs, this was the only thing that finally worked to get it going again. Thank you – djohns505 Sep 15 '20 at 16:08
  • Removing ~/.vscode finally did it for me. I specifically wanted to remove extensions and that's where they were stored. Thanks! – Nevermore May 28 '22 at 19:59
  • It seems there is also an alias `/usr/local/bin/code` that needs to be removed – The Matt Dec 03 '22 at 02:17
65

The solution to my problem was to cd to the following path... /Users/<user>/Library/Application\ Support and delete the folder called Code. That folder contains all the setting and is not overwrite with a new installation. Looking through the entire file structure, VSCode name folder different. Sometimes folders are called .vscode/, or code/, or Visual Studio Code.app.

redeemefy
  • 4,521
  • 6
  • 36
  • 51
  • 1
    Wrong. There is also `.vscode` at the root directory and a file other files in other places as pointed out by other answers – abc Mar 10 '22 at 19:35
65

This worked for me ( VS Code 1.30 with MacOS - High Sierra 10.13.6 )

Step 1:

Close VS Code

Step 2:

rm -rf $HOME/Library/Application\ Support/Code

Step 3:

rm -rf $HOME/.vscode

Step 4:

Remove VSCode from application

Step5:

Reinstall VS Code if needed
NearHuscarl
  • 66,950
  • 18
  • 261
  • 230
viru
  • 2,081
  • 19
  • 23
29

If using a 3rd-party application is OK, check out App Cleaner.

It basically does the same thing as the other answer, but via a GUI and you don't have to manually remove all files/dirs one-by-one. Just drag VS Code from the Applications folder into App Cleaner, then it will find all the related files for you, and then you just have to click on the Remove button.

App Cleaner

UPDATE (VS Code 1.46)

Based on a recent comment, even after using AppCleaner, re-installing VS Code seems to still "remember" your previous extensions. This is caused by a ~/.vscode/extensions folder, which for some reason, AppCleaner can't "see" and is not listed in its UI. You will have to remove this folder manually.

~$ find ~/. -maxdepth 1 -name .vscode -type d
/Users/gino/./.vscode

~$ ll /Users/gino/./.vscode/extensions
total 0
drwxr-xr-x  15 gino  staff   480B Jun 30 14:14 dbaeumer.vscode-eslint-2.1.5/
... (all other extensions) ...

~$ rm -Rf /Users/gino/./.vscode
Gino Mempin
  • 25,369
  • 29
  • 96
  • 135
  • 4
    I used app-cleaner and it didn't remove everything. I say this because when I reinstalled VSC it loaded the previous 2 extensions I had in VSC. – Michael1775 Jun 30 '20 at 03:22
  • @Chris'sDad Hmm.. I think some changes in VS Code (since I wrote this answer) moved some folders around and those are not detected by AppCleaner. On testing this now with VS Code 1.46 and AppCleaner 3.5, it is leaving the `~/.vscode` folder which contains an `extensions` folder. That `.vscode/extensions` folder is keeping track of your installed extensions. AppCleaner unfortunately can't seem to "see" it, so it has to be removed manually :( – Gino Mempin Jun 30 '20 at 05:17
  • @Chris'sDad Files that start with a `.` are hidden files. You need to configure Finder to [show hidden files](https://apple.stackexchange.com/q/58709/253138). – Gino Mempin Jul 22 '20 at 05:07
  • 2
    Really genuine help with UPDATE (VS Code 1.46), I was facing a lot of issues and getting no resolution though so many answers are already available here. Thanks Pal. – madhav nandan Feb 25 '22 at 11:53
5

The homebrew cask code for VSCode provides a nice list of all the folders that you have to delete manually after moving the app itself into the trash:

- ~/.vscode
- ~/Library/Application Support/Code
- ~/Library/Application Support/com.apple.sharedfilelist/com.apple.LSSharedFileList.ApplicationRecentDocuments/com.microsoft.vscode.sfl*
- ~/Library/Caches/com.microsoft.VSCode.ShipIt
- ~/Library/Caches/com.microsoft.VSCode
- ~/Library/Preferences/ByHost/com.microsoft.VSCode.ShipIt.*.plist
- ~/Library/Preferences/com.microsoft.VSCode.helper.plist
- ~/Library/Preferences/com.microsoft.VSCode.plist
- ~/Library/Saved Application State/com.microsoft.VSCode.savedState
Jagmit
  • 163
  • 2
  • 8
2

Here is my approach:

  1. Open finder
  2. Click on Home icon(which has your username as label)
  3. Click on Library Folder. Note Library folder may be hidden, so you will need to click on Shift+CMD+. to open hidden files and folders.
  4. Click Application Support folder
  5. Find Code folder beneath Application Support and delete it(You delete Code Folder of course)
Tom Seidel
  • 9,525
  • 1
  • 26
  • 38
Hakim Asa
  • 443
  • 3
  • 15
  • This doesn't seem to be the full story. After following these instructions and then reinstalling VS Code, it picks up at the same project it was at last time when I go to 'open folder' – ninjaPixel Apr 28 '20 at 16:22
  • Same here. VS doesn't ever seem to completely uninstall. I'm actually trying to configure it to use Java / Maven. I also followed this link https://softwarekeep.com/help-center/how-to-uninstall-microsoft-visual-studio but nothing seems to allow me to completely uninstall VS? – jay tai Jul 10 '21 at 07:20
0

If these steps are not enough, like for me, please consider removing these file and directory:

  • /usr/local/Caskroom/visual-studio-code
  • /usr/local/Library/Taps/caskroom/homebrew-cask/Casks/visual-studio-code.rb

Run in a shell the following commands to check for others file or directories:

  • locate visual-studio-code
  • locate vscode
  • locate code

Bye.

trashyms
  • 21
  • 2
0

I lost my old mac and had to reinstall vscode on my new mac. I thought I had lost all of my extensions but when I logged on the vscode they all seem to be stored on my vscode account. I don't know if that will make a difference.

T L C
  • 1