Posted over 10 years ago. Visible to the public. Linked content.
Sublime Text 2 on the OS X Command Line
To use Sublime Text 2 as command line editor, you need to create a symlink:
If installed via Homebrew Cask:
Copyln -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:
Copyln -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:
Copyvi .bashrc export EDITOR='subl -w'