Created
November 22, 2013 23:30
-
-
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.
This file contains 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
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