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" /bin/subl


However, I am getting this error:

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


How do I get around this?


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\'

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



Try this on Mac:

sudo ln -s /Applications/Sublime\ Text\ /bin/subl




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.



All Articles