Trying to set up sublime text 2 to open files in unix terminal but getting error

I am trying to create sublime text 2 to open a file in my cygwin terminal using the 'subl [file]' command. I am running the command below in my terminal as mentioned on several sites.

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

      

However, I am getting this error:

ln: failed to create symbolic link `/bin/subl': File exists

      

How do I get around this?

+3


source to share


3 answers


Perhaps you could try using "alias" instead?

Add a line to your .bashrc file similar to:



alias subl = '/cygdrive/c/Applications/Sublime\Text\2.app/Contents/SharedSupport/bin/subl'

Then run the command 'source.bashrc' to load the new alias.

+3


source


Try this on Mac:



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

      

+3


source


You're on Windows, right? This directory you are trying to point to is the Mac OS Sublime Text 2 installation directory. You probably need something like this, but copy the path to sublime_text.exe to match yours:

ln -s /cygdrive/c/Program\ Files/Sublime\ Text\ 2/sublime_text.exe /usr/local/bin/subl

      

Make sure /usr/local/bin

is some directory in your PATH ( echo $PATH

to find out) for your subl command to work from anywhere. Then you can do subl .

from any project directory to open that project in Sublime.

+2


source







All Articles