Sublime Text 2 on the OS X Command Line

Updated . Posted . Visible to the public.

To use Sublime Text 2 as command line editor, you need to create a symlink:

If installed via Homebrew Cask:

ln -s "/opt/homebrew-cask/Caskroom/sublime-text/2.0.1/Sublime Text 2.app/Contents/SharedSupport/bin/subl" /usr/local/bin/subl

or, if installed manually:

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

And if you want to use it as your default editor e.g. for git status messages, set your EDITOR environment variable like this:

vi .bashrc

export EDITOR='subl -w'
Matthias Marschall
Last edit
Matthias Marschall
Keywords
OSX
Posted by Matthias Marschall to Matthias Marschall (2012-05-03 11:53)