美文网首页
macOS用命令快速打开Visual Studio Code

macOS用命令快速打开Visual Studio Code

作者: 泛酸的桂花酒 | 来源:发表于2021-07-14 10:07 被阅读0次

采用的是软连接思路
设置软连接

cd /usr/local/bin/
sudo ln -s "/Applications/Visual Studio Code.app/Contents/MacOS/Electron" code

设置环境变量

export PATH=$PATH:/Applications/Visual\ Studio\ Code.app/Contents/Resources/app/bin

尝试一下
新建一文件夹打开vscode

mkdir testProject
cd testProject
code ./

顺利打开vscode,实际开发过程,就省去了打开vscode,在打开文件目录的麻烦,直接 code 路径 即可打开

相关文章

网友评论

      本文标题:macOS用命令快速打开Visual Studio Code

      本文链接:https://www.haomeiwen.com/subject/rjtypltx.html