Skip to main content

如何在终端使用VS Code打开指定文件

1️⃣ 打开 VS Code

2️⃣ 按快捷键:

Cmd + Shift + P

打开 Command Palette

3️⃣ 输入:

shell command

选择:

Shell Command: Install 'code' command in PATH

点击执行。


关闭当前 terminal,然后重新打开一个 terminal。

或者执行:

exec zsh

然后就可以使用 code+路径 来打开文件了