10 09/2014

sublime 终端命令行

最后更新: Wed Sep 10 2014 12:39:11 GMT+0800

根据官方说法:OS X Command Line,是在 ~/bin 建立符号链接。

ln -s "/Applications/Sublime Text 2.app/Contents/SharedSupport/bin/subl" ~/bin/subl

但官方还说如果装了 Macports 的话,上面办法不行,但没说该怎么办。

If you have the MacPorts version of Python installed, then starting Sublime Text 2 via the subl will not work correctly. As a workaround, start Sublime Text 2 first via Finder, and then interact with it using subl.


vim ~/.bash_profile


alias subl="'/Applications/Sublime Text 2.app/Contents/SharedSupport/bin/subl' $1"


subl AAAA.txt

设置 sublime 为默认的文本编辑器

To use Sublime Text 2 as the editor for many commands that prompt for input, set your EDITOR environment variable:

export EDITOR='subl -w'