38

Is it possible to change the default opening and saving location when trying to open and/or save a file.

The default location seems to be the root, but I would like it to be the desktop.

JasonMArcher
  • 14,195
  • 22
  • 56
  • 52
nbro
  • 15,395
  • 32
  • 113
  • 196
  • 2
    On Windows 10 the default Visual Studio Code location for opening new files and folders is `c:\users\username`. I am looking for a way to change that to be the folder where I keep VS Code projects like in `PlatformIO` where you can just type `pio settings set projects_dir some_path` but didn't find a way. – Chupo_cro Mar 06 '21 at 19:56

5 Answers5

7

I haven't found anything in the Preferences settings that would support this, nor found anything stating that this is supported.

As you've stated yourself, the default location is the root of your system. At least, if you aren't working in a folder.

What you could do, of course, is simply open your ~/Desktop as a folder in VSCode. Then, automatically, your default save location is exactly as you'd like it to be.

Juliën
  • 9,047
  • 7
  • 49
  • 80
3

In case anyone is still looking for this, you set this in settings.json using the key "git.defaultCloneDirectory"

1

What worked for me:

Find the path of the folder - in my case it was in C:\Users\username\OneDrive\GitHub...

To change it:

  • Close VS Studio
  • Cut/copy the folder from the directory it's in
  • Paste into the folder into the directory you want it to Example: C:\Users\username\Desktop\GitHub\CS50...
  • Open up VS Code and it will prompt you to Find a folder (or such) for your Explorer
  • Click into the parent folder within the directory and opening the parent folder should open the subsequent children folders with your code.

Every file should open up as long as you open up the parent folder to the smaller directories.

Hope this helps. -Gorillana

Gorillana
  • 11
  • 1
0

You can change the location of your projects/solutions. File -> Open -> Projects/Solutions

To do this modify Tools -> Options -> Projects and Solutions -> Locations

I think that's the closest you can get.

CBFT
  • 273
  • 2
  • 14
-3

The topic is documented in multiroot workspaces. https://code.visualstudio.com/docs/editor/multi-root-workspaces

Just for reading, though I couldn't find default folder config by the first look into the article.

Zailux
  • 500
  • 5
  • 12