兩種終端
1、ZSH
如果使用 zsh 作為終端(比如 oh-my-zsh)。
cd /usr/local/bin
ln -s "/Applications/Sublime Text 3.app/Contents/SharedSupport/bin/subl" subl
該命令對(duì)于 Sublime Text 2 與 Sublime Text 3 是一樣的。
參考:
https://superuser.com/questions/968487/how-to-set-symlink-short-cut-to-sublime-text-3-in-terminal
2、傳統(tǒng)默認(rèn) Bash
ln -s "/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl" /usr/local/bin/sublime
參考:
http://olivierlacan.com/posts/launch-sublime-text-3-from-the-command-line/
終端運(yùn)行 Sublime Text 命令
subl
如果是打開當(dāng)前目錄,末尾加上.
subl .