標簽: Mac Sublime
在Mac下用終端創(chuàng)建文件等比較方便,但如果配合Sublime用,最好是可以直接在終端中輸入命令就可以用Sublime打開指定文件或文件夾。
- 檢查用戶目錄下有沒有bin目錄,如里沒有就創(chuàng)建一個(目的是創(chuàng)建環(huán)境變量)
$ cd ~
- 在bin目錄中建立Sublime的別名 (注意到你的應(yīng)用程序看是不是這個名)
$ sudo ln -s "/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl" ~/bin/subl
- .bash_profile中添加環(huán)境變量
在用戶目錄下檢查用沒有.bash_profile茶鹃, 沒有則添加
打開.bash_profile涣雕,添加
$ export PATH="~/bin:$PATH"
- 最后當然是生效.bash_profile
$ source ~/.bash_profile
- 終端中用Sublime打開xx文件夾
$ source subl xx
sublime.gif