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?
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
With the 0.3.0 update we added a new command to close a folder. You can find it under the File menu.
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.
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.
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
if open a folder in workspace ( File > Add Folder to Workspace ) you can close folder with [ right click on folder name > remove folder from workspace ] but if you open folder from (file > open folder) you can close with [File > Close Folder]
Related
I don't see a keyboard shortcut for "Open Folder..." listed on the documentation page below, and after searching elsewhere for a while I didn't see anything else.
https://code.visualstudio.com/docs/customization/keybindings
I thought I would ask here before putting an issue on GitHub about it. (Also there doesn't seem to be a open / closed issue about this anywhere on the GitHub repo.)
https://github.com/Microsoft/vscode/issues
There is indeed a shortcut for it, the command is workbench.action.files.openFolder, and the default keybinding is Ctrl+K,Ctrl+O.
It's easy to find in the list of shortcuts (File → Preferences → Keyboard Shortcuts) if you search for "folder" or "openFolder" in the Default Keybindings.
Hit Cmd+O on macOS or Ctrl+O on Windows/Linux to activate the open dialog, select a folder, and click "Open."
Note: This answer was written before multiple folder workspaces were implemented in VS Code. If you open folders this way, it will replace your entire workspace with the folder you selected to open. If you want to add a folder to your existing workspace, you must use Cmd+K, Cmd+O on a macOS or Ctrl+K, Ctrl+O on Windows/Linux.
I've had a change of file name and also I want to close this folder from the explorer, and also open a new one.
So my requests are:
How do I close this file and reopen it
How do I close the folder tab entirely so no folders are opened
Go to File > Close Folder/Workspace
OR use Ctrl/Cmd + K F as keyboard shortcut.
Use Ctrl + W to close a file.
After I use VSCode to open a folder and some editors for the files, I close the folder. When I close and reopen the folder, VSCode opens the editors I opened last time.
How to prevent VSCode from reopening the editors I opened last time?
I have already set "window.restoreWindows": "none". When I exit directly from VSCode, it won't restore windows. I am saying when I reopen a folder, the editors I opened last time before I close the folder, will still be opened.
To stop Visual Studio Code from opening your previous folder all the time, then you have to edit settings.json.
To achieve this, open the settings.json. Do this by following the steps below.
Open the Command Palette by pressing F1.
Type, "Open settings".
When you see the options, select Open Settings (JSON).
After that, add the following option.
{
"window.restoreWindows": "none"
}
This should prevent Visual Studio Code from opening the previous folder when launching the application.
I just open vscode from my terminal, it's way faster and efficient in my opinion.
Just browse to your wished folder and write "code ." in your terminal.
Follow this process
Open VS Code, goto file>preferences>settings.
search for restore Window or click on Window tab then find restore window .select none from selection.
https://i.stack.imgur.com/FLx4a.png
https://i.stack.imgur.com/TAuHT.png
https://i.stack.imgur.com/B8W5a.png
Is there a way to open files from Eclipse' local terminal? i.e. ctrl + left click to open in a tab in eclipse?
When I want to Ctrl + Click the error link in terminal VS Code (first project), it showing Open folder in new window (I felt uncomfortable when this happened)
Open folder in new window
but when open second project file and ctrl + click the error link in terminal VS Code, it showing Open file in editor
Open file in editor
I want to set default my terminal, if I ctrl + click on terminal, it showing Open file in editor (second project).
Do you know how to do it?