两种终端
1、ZSH
如果使用 zsh 作为终端(比如 oh-my-zsh)。
cd /usr/local/bin
ln -s "/Applications/Sublime Text 3.app/Contents/SharedSupport/bin/subl" subl
该命令对于 Sublime Text 2 与 Sublime Text 3 是一样的。
参考:
https://superuser.com/questions/968487/how-to-set-symlink-short-cut-to-sublime-text-3-in-terminal
2、传统默认 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/
终端运行 Sublime Text 命令
subl
如果是打开当前目录,末尾加上.
subl .