Skip to content

Instantly share code, notes, and snippets.

@aikalima
Last active December 18, 2015 15:59
Show Gist options
  • Save aikalima/5808229 to your computer and use it in GitHub Desktop.
Save aikalima/5808229 to your computer and use it in GitHub Desktop.
**How to open Sublime from the command line**
1. Verify that `Sublime Text 2` is installed in your `Applications` folder
2. Launch Sublime from the GUI and open the file `.bash_profile` OR `.zshrc` in your HOME directory.
3. Copy/Paste this line to .bash_profile:
```
alias subl='/Applications/Sublime\ Text\ 2.app/Contents/MacOS/Sublime\ Text\ 2 $1'
```
4. Close and re-open your Terminal or ITerm
5. Now type `subl` and Sublime should start up. You can also pass a file name or and entire folder to subl like this:
```
$> subl my_cool_program.rb
$> subl .
```
The last command opens the current folder
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment