Tag Archives: cli

Enabling Sublime Text for Command Line Use

I have been using Sublime Text 2 on my PC for a few months and now that I have a Mac, I got around to installing it today. I have been used to modifying scripts and code snippets from the command line by usingĀ “subl <filename>”. Unfortunately, that didn’t work after installing Sublime. I’ve read other blog and seen people use it so I figured that it was just an error after installation. Let’s fix it!

The first thing we need to do is create a .bash_profile file if we don’t have one already.

touch ~/.bash_profile

Then we can add this nifty alias to our .bash_profile:

alias subl=”/Applications/Sublime\ Text\ 2.app/Contents/SharedSupport/bin/subl”

Finally, reload that bad boy

source ~/.bash_profile

This was a head scratcher but a quick fix.