其实你只需要看下面这两行
Ctrl+J
调出Terminal
面板
code -a 目录名
这一步相当于File
–>Add Folder to Workspace...
。
目录名可以是绝对路径、相对路径、或.
和..
都可以。
查看VSCode的选项。其中-a
相当于--add
E:\web\test-express>code --help
Visual Studio Code 1.45.1
Usage: code.exe [options][paths...]
To read output from another program, append '-' (e.g. 'echo Hello World | code.exe -')
Options
-d --diff <file> <file> Compare two files with each other.
-a --add <folder> Add folder(s) to the last active window.
-g --goto <file:line[:character]> Open a file at the path on the specified
line and character position.
-n --new-window Force to open a new window.
-r --reuse-window Force to open a file or folder in an
already opened window.
另:
xxx.code-workspace
{
"folders": [
{
"path": "E:\\web\\static-server"
},
{
"path": "E:\\web\\test-express"
}
],
"settings": {}
}