现在 ~/.zshrc
或者 ~/.bashrc
里面增加如下一行命令,用以设置好 alias:
alias subl=\''/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl'\'
设置软连接
$ sudo ln -s "/Applications/Sublime\ Text.app/Contents/SharedSupport/bin/subl" /usr/local/bin/subl
在当前文件夹下打开sublime:
$ subl .
参考
https://www.laravist.com/blog/post/open-sublime-project-in-command-line-on-mac