鍍金池/ 問答/Linux/ mac 上如何用終端打開 VS code ?

mac 上如何用終端打開 VS code ?

mac 上,使用終端工具(命令行)打開 atom 編輯器:

# 進入項目文件夾
cd desktop/demo

# 使用 atom 打開項目
atom ./

最近在想,使用終端工具(命令行)如何打開 VS code 編輯器,或者 subline test 呢?

回答
編輯回答
孤影

vscode文檔提到,在vscode執(zhí)行shell command

Open the Command Palette (??P) and type shell command to find the Shell Command: Install 'code' command in PATH command.
2017年4月19日 07:58
編輯回答
久不遇

open template -a Sublime\ Text

open -a的作用就是使用指定的應(yīng)用程序打開。這樣看起來似乎有點繁瑣,但實際上可以使用tab鍵進行聯(lián)想應(yīng)用名的。

比如輸入open template -a Sub, 應(yīng)用里只有一個是sub開頭的應(yīng)用名,因此會補全這個名字。


除了這種原生命令行的模式外,還可以注冊vscode的命令。
按住win + shift + p輸入code,會出來一個注冊code的命令。輸入code .就會用vscode打開當(dāng)前的文件夾。

clipboard.png

2017年2月25日 06:41