macOS命令行使用code打开VS Code
1. 前言
在终端直接用 code . 打开当前文件夹,Visual Studio Code 自带此功能,需进行设置。
2. 设置
-
打开 Visual Studio Code。
-
按下快捷键
⌘ + ⇧ + P打开命令面板。 -
输入并选择:
Shell Command: Install 'code' command in PATH
- 打开终端,输入:
code .
- 查看路径:
where code
/usr/local/bin/code