0

I am trying to get sublime text to run from the command line using this tutorial.

It says to run this command:

ln -s "/Applications/Sublime Text 2.app/Contents/SharedSupport/bin/subl" ~/bin/subl

But when I try to run that command I get an error "no such file or directory." Sublime text 2 is in my applications folder -- but it looks like there is no bin folder in my home directory. Do I need to create one? Is this something that should be there? Am I doing something wrong?

2

Yes simply create the ~/bin directory and then create the link. I doubt it should be there, but it's generally a best practice on Unix systems to create a ~/bin to maintain extraneous executables that you'd like to use within your personal environment.

Additionally you'll need to make sure that this directory is also on your PATH (echo $PATH) so that you can execute this command from any location on your system, without have to explicitly call it out as:

$ ~/bin/subl
  • FWIW, on Mac OS X I use ~/.bin so the directory doesn't appear in the Finder, since I'm only interested in those files from the terminal. – Wildcard Oct 18 '16 at 4:02
0

I do it this way open -a "sublime text" index.html, you can create an alias in your shell profile configuration so it can be shorter alias subl='open -a "sublime text"'

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.