Skip to content

Instantly share code, notes, and snippets.

@onetwopunch
Created November 22, 2013 23:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save onetwopunch/7608653 to your computer and use it in GitHub Desktop.
Save onetwopunch/7608653 to your computer and use it in GitHub Desktop.
I like using Sublime Text but I wanted a quick way to use it from the Terminal in MacOSX. This is how you use Sublime Text in the Terminal just like vim.
First, you create a new file: ~/Scripts/lime.sh
file=$1
if [ ! -e "$file" ] ; then
touch "$file"
fi
open -a Sublime\ Text\ 2 $file
Since I keep this with my handy scripts in my home directory, I just make it executable to other users with:
chmod 711 lime.sh
Then just add a soft link in /usr/bin
ln -s ~/Scripts/lime.sh /usr/bin/lime
Now to open a file in Sublime Text 2, just use:
lime my_file.txt or
lime my_directory
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment