If you don't want to use Sublime Text 3 yet, which has a lot of differences from Sublime Text 2, and is still in beta, here's how to fix your problem. Just run each of these commands (in order) from Terminal and you should be all set:
sudo rm -rf /usr/local/bin/subl
This will remove whatever subl
links are in /usr/local/bin
. Then:
sudo ln -s /Applications/Sublime\ Text\ 2.app/Contents/SharedSupport/bin/subl /usr/local/bin
This recreates the link to the proper location. Make sure you run the command exactly as I typed it, or it won't work. I'll explain why in a moment. Finally, restart Terminal and enter:
subl
to make sure the process worked.
The reason your
sudo ln -s "/Applications/Sublime\ Text\ 2.app/Contents/SharedSupport/bin/subl" /usr/local/bin/subl
command didn't work was because you included the Applications/...
path in quotes "
and also escaped the spaces using a backslash \
. You should do one or the other, but not both. My command above just uses \
to escape the spaces. When you use quotes, each character in the string is included literally, including the \
characters. This is why the file was blank when you opened it in vim
- it was pointing to a path that didn't exist.
By the way, while you can open /usr/local/bin/subl
in vim
, I wouldn't recommend it because it's a binary executable file, so you'll just get garbage on your screen.
Good luck!
subl abc.txt
from terminal, by default, so you might want to try it.deb
packages, so unfortunately that solution is irrelevant here. Creating thesubl
link isn't too hard, you just need to make sure the path is correct - see my answer below.