Instantly share code, notes, and snippets.

@ezos86 /sublime
Last active Aug 29, 2015

What would you like to do?
Launching Directory from CLI or Terminal with Sublime
if [ ! ${DIRECT} ]; then
echo "Launching Current Directory"
open -a "Sublime Text" $DIRECT -n

This comment has been minimized.

Copy link

ezos86 commented Jan 31, 2015

Install Directions

Mac OS - Open Terminal


cd usr/local/bin

Next type.

sudo nano sublime

Then paste the code from the gist into the file. Then hit ctrl+x and then y to confirm you want to save. After this you will need to make the file executable. Still in the 'usr/local/bin' directory.


chmod +x sublime

Now you can type 'sublime' into the command line and specify a directory of if you don't. It will open the current directory in Sublime Text editor. Enjoy!

***NOTE: This is Sublime Text 3 - if you are going to use Sublime Text 2 - Change "Sublime Text" on line 18 to "Sublime Text 2"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment