

- #RUN COMMAND ON SUBLIME TEXT FOR MAC HOW TO#
- #RUN COMMAND ON SUBLIME TEXT FOR MAC MAC OS X#
- #RUN COMMAND ON SUBLIME TEXT FOR MAC INSTALL#
Since we create a symlink to subl called sublime in the /usr/local/bin directory let’s check if this directory is listed on that same line. This contains all the directories that will be looked into for executable binaries when you type a command in Terminal. You should see at the top of the file a line that starts with: export PATH= (In some cases the profile file is named ~/.profile). Now let’s do a check to see if everything will run smoothly. This will simply create a symlink called sublime (remember, we like names that don’t suck to type 500 times a day) between the subl binary stashed in the Sublime application package, and a folder where your system usually looks for binaries to execute (launch). Symlink Creation ln -s "/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl" /usr/local/bin/sublime
#RUN COMMAND ON SUBLIME TEXT FOR MAC HOW TO#
This and one or two more steps to tell Bash where the command is located and how to remember it. This will basically allow the installation of the sublime command. Installationįirst thing we do is create a symlink to make the app link to the bin folder to trigger it as a command from the command line. Suggestions there are not followed as we do a slightly adjusted setup based on Artero’s recommendations. You can find more details about subl here: . open /Applications/Sublime\ Text.app/Contents/SharedSupport/bin/subl If this following line opens Sublime Text for you, then bingo, you’re ready. This utility is hidden in the following folder (assuming you installed Sublime in /Applications like normal folk. Sublime Text 3 ships with a CLI called subl (why not “sublime”, go figure). Textmate ads it to your path for you, but for Sublime you have to do all the legwork yourself. Something I missed after moving from TextMate to it. It explains how you can get Sublime 3 to work from the command line. A fork I have adjusted and updated some more in this blog post. Have fun, Sublime is a great editor showing a lot of promise.Text below is a gist fork of gist by Artero with basic adjustments to use Sublime Text 3 from Command Line in OSX. bash_profile which you would have needed with the official instructions given by the Sublime team. Now you don't need to get out of Terminal to simply open a file or a folder, you didn't have to add an "alias" or yet another bin directory to your. (to open the entire current directory) Conclusion Sublime foldername (replace "foldername" by an actual folder name) Sublime filename (replace "filename" by an actual file name) bash_profile with the newly added directory. If you had to add /usr/local/bin to your PATH, run the following command before continuing: If you don't already have a PATH set in your bash_profile you can type: Note: The '(.)' in this example represents other folders that would be listed on the same line and separated by a colon. If not, simply add it like this and save the file:

Since we create a symlink to subl called sublime in the /usr/local/bin directory let's check if this directory is listed on that same line.

You should see at the top of the file a line that starts with: (In some cases the profile file is named ~/.profile) Now let's do a check to see if everything will run smoothly. This will simply create a symlink called sublime (remember, we like names that don't suck to type 500 times a day) between the subl binary stashed in the Sublime application package, and a folder where your system usually looks for binaries to execute (launch). Ln -s /Applications/Sublime\ Text\ 2.app/Contents/SharedSupport/bin/subl /usr/local/bin/sublime So contrary to the Sublime team recommendation, we're not going to create a bin folder in your home directory:
#RUN COMMAND ON SUBLIME TEXT FOR MAC INSTALL#
That's weird, I don't recall ever being asked to do that on OS X since most people install binaries within /usr/local/bin which – if you're a developer – is likely to already have tons of other binaries. The official documentation I linked to above recommends creating a ~/bin folder (in your home directory). You can find more (official) details about subl here: Installation Open /Applications/Sublime\ Text\ 2.app/Contents/SharedSupport/bin/subl If this following line opens Sublime Text for you, then bingo, you're ready. Sublime Text 2 ships with a CLI called subl (why not "sublime", go figure).
#RUN COMMAND ON SUBLIME TEXT FOR MAC MAC OS X#
Launch Sublime Text 2 from the Mac OS X Terminal
