In VS Code, I can Ctrl+P and paste the path to a file and open it. However, if I choose "open folder", I get a clunky "open folder" interface with icons and and OK button that I need to spend time navigating using point-and-click.
Is there an equivalent to Ctrl+P but for folders instead? I already have the full path to the folder in my clipboard; I really don’t want to waste time looking through lists of icons and double clicking them.
Of course, I know that I can just open terminal and do "code path/to/folder", but that opens up a new window. I want to just do Ctrl+P but for folders, i.e. in an existing window, with the path instead of icons.
2
Answers
If the problem is just that using
code <path>
opens in a new window, then the solution is to use the--reuse-window
flag. The flag’s description:Your system’s default file explorer application probably has an input element at the top of its window where you can paste in a full path as well.
You can also switch to VS Code’s simple file explorer UI instead of the system file explorer by setting
"files.simpleDialog.enable": true
in your settings.json file. The setting’s description:In VS Code preferences, navigate to Files > Simple Dialog, and check the box. This uses a simple file dialog, instead of the system file dialog. To open a file, use ctrl+o, and to open a folder, use ctrl+k ctrl+o. (This can be remapped).
This can also be enabled in
settings.json
: