Twitter

FreshBooks

« iOS Hide Keyboard Method | Main | Announcing Seed Coworking »
Thursday
Jan122012

Creating a Terminal Shortcut for SubLime

At a recent programming (nerd) conference, I got to see the SubLime text editor in action and I liked what I had seen.  I have been a loyal user of TextMate, but I like some of the shortcut keys and the look and feel of SubLime.  The one issue I ran into immediately with SubLime was the opening of a project from Terminal.  Not a big deal, but I am always using git to get the latest code prior to opening the project, so it is very natural for me to want to use the keyboard to open up the editor.  There is a very simple fix that I thought I would share to handle this issue.  I used the unix 'ln' command to link the application to the command 'subl'.  This is easy enough once you know where the command resides within the application package.  The following syntax can be ran from the Terminal screen to create an alias to open projects up within Terminal.  Notice the backslashes to identify the spaces in the path.  Happy coding!

sudo ln -s /Applications/Sublime\ Text\ 2.app/Contents/SharedSupport/bin/subl /bin/subl

 

Reader Comments (2)

That's great. I did something similar on Ubuntu but made the link simply "s" so I just type "s filename" in the terminal. Less typing :)

January 12, 2012 | Unregistered CommenterArsalan Ahmed

Thanks dude. Worked like a champ.

January 20, 2012 | Unregistered CommenterJamie

PostPost a New Comment

Enter your information below to add a new comment.

My response is on my own website »
Author Email (optional):
Author URL (optional):
Post:
 
Some HTML allowed: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>