Search code examples
unixterminalcygwin

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


I'm trying to set up sublime text 2 to open a file in my cygwin terminal by using the command 'subl [file]'. I run the below command in my terminal as instructed in a number of sites

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

However, I get this error:

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

How do I work around that?


Solution

  • 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 do a 'source .bashrc' command to load the new alias.