【问题标题】:vscode command line : open a file of an opened projectvscode 命令行:打开已打开项目的文件
【发布时间】:2021-12-06 09:12:55
【问题描述】:

我在 vscode 中打开了一个项目。

我在项目目录下的 Windows Powershell,当我键入时

code test.html

它将打开文件,但使用新的 vscode 实例,我想在已经打开的项目中代替:有可能吗?

【问题讨论】:

    标签: powershell visual-studio-code


    【解决方案1】:

    是的,可以使用-r (--reuse-window) 选项。
    例如:

    code -r .\Dockerfile
    

    (https://code.visualstudio.com/docs/editor/command-line)

    【讨论】:

    • 如果你在 vscode 中使用 PowerShell 集成终端,你也可以使用psedit file.txt
    • psedit 是 Open-EditorFile 的别名,绝对比使用 -r 更好,后者会重新加载窗口,打断您可能正在处理的任何其他内容。
    猜你喜欢
    • 1970-01-01
    • 2020-10-18
    • 2012-02-12
    • 2019-12-29
    • 2013-06-23
    • 2012-08-01
    • 1970-01-01
    • 1970-01-01
    • 2021-09-28
    相关资源
    最近更新 更多