I recently installed Visual Studio Code to just touch stuff up on my laptop when I work with friends on projects, and I've been wondering how to set a default directory for the folder. It's kind of annoying to have to set the folder every time I open the editor.
4 Answers
Here what VS Code says:
// An explicit start path where the terminal will be launched, this is used as the current working directory (cwd) for the shell process. This may be particularly useful in workspace settings if the root directory is not a convenient cwd.
So, you have to edit this variable:
"terminal.integrated.cwd": ""
For instance on Gnu-Linux/Unix like:
"terminal.integrated.cwd": "/home/oldman/C#/ASP.MVC"
On Windows
"terminal.integrated.cwd": "C:\Users\oldman\C#\ASP.MVC"
Your terminals will be set at this current working directory (cwd) as for your root directory in the explorer, (here "/home/oldman/C#/ASP.MVC" on linux, and "C:\Users\oldman\C#\ASP.MVC").
-
3This answer references running a terminal from within VS Code, which is different than opening a default folder.– m0j0Commented Jul 22, 2021 at 14:12
autohotkey can help
add a hotkey to this
vscode_wf:= "C:\Users\noway\AppData\Local\Programs\Microsoft VS Code\code.exe"
Run, %vscode_wf% "D:\markdown_folder", ,Max
Go to your VS Code shortcut, right-click it then go to "Properties". After the path of VS Code, insert the path of your folder
image showing the instruction above:
I am not sure if I have understood the question correctly, but the following comes to mind.
- Add Visual Studio Code to Your Context Menu and open any folder directly with a simple click.
- Adapt your settings to control how windows are being reopened after starting vscode i.e.
"window.restoreWindows": "all"
- Install an extension like Reopen Folder
Hope this helps you.