Last active
August 29, 2015 14:14
-
-
Save ezos86/580361d90d05450d5ab0 to your computer and use it in GitHub Desktop.
Launching Directory from CLI or Terminal with Sublime
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
DIRECT=$1 | |
if [ ! ${DIRECT} ]; then | |
echo "Launching Current Directory" | |
DIRECT='.' | |
fi | |
open -a "Sublime Text" $DIRECT -n |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Install Directions
Mac OS - Open Terminal
Type.
cd usr/local/bin
Next type.
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.
Type
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"