How to close an opened folder in Visual Studio Code?
Visual Studio-CodeVisual Studio-Code Problem Overview
I love VSCode. But I can't find a way to close an opened folder. It seems that you can only open one folder at a time. And the only way to close it is to close the whole program?
Am I missing something?
Visual Studio-Code Solutions
Solution 1 - Visual Studio-Code
The command to close the currently opened folder can be found from File
-> Close Folder
.
You can also use the shortcut:
Ctrl+K F
(press and hold Ctrl
, then press and release K
, then release Ctrl
, and then press F
)
And on a Mac:
ā+k f
Solution 2 - Visual Studio-Code
With the 0.3.0 update we added a new command to close a folder. You can find it under the File
menu.
Solution 3 - Visual Studio-Code
VSCode doesn't have an explicit close folder gesture yet. You can either select File > Open Folder
in a open windows of VSCode or select File > New Window
and in there File > Open
. Having multiple open folders inside a single window isn't supported.
Solution 4 - Visual Studio-Code
As VS Code remembers the last session when opened, you can:
- open New Window (Ctrl+Shift+N) - this will open new VS Code with no project folders opened,
- close the old window (with opened project folder),
- close the new one.
Next time you run VS Code, it should look like the last window you closed and thus without any folders opened.
Note that this process closes ALL opened folders.
Solution 5 - Visual Studio-Code
For all what you have in your mind for "Visual Studio Code" use simply "Command Palette" throught
> menu: VS Code / View / Command Palette... > > keyboard: CMD / CTRL + SHIFT + P
and then you can find all by text.
> text: Close All Editors > > keyboard: CMD / CTRL + K + W
Also you can find and redefine all "Key Bindings" here
> menu: VS Code / Code / Preferences / Keyboard Shortcuts > > keyboard: CMD / CTRL + K + S