I'm having difficulty getting this set up. I fixed my .bash_profile
, and created the symlink using the following command from the Sublime website:
ln -s "/Applications/Sublime Text 2.app/Contents/SharedSupport/bin/subl" ~/bin/subl
Yet, when I input that command I get:
ln: /Users/my_username/bin/subl: No such file or directory
It appears my terminal is looking at the wrong place for the file? Why is it trying to point to a bin
folder on my home directory?
Sublime Text includes a command-line helper called subl . Using the command-line helper, you can open files and folders and perform other actions from the command line. Before using subl , make sure it is on your PATH . To put subl on your PATH , you may need to add directories to PATH or use symbolic links.
Documentation Command Line Interface. Version: Sublime Text includes a command line tool, subl , to work with files on the command line. This can be used to open files and projects in Sublime Text, as well working as an EDITOR for unix tools, such as git and subversion.
What we want to do is create an alias for the sublime_text.exe found within the Sublime Text 3 folder. Then when we type the alias into Git bash it auto launches the text editor.
Create the symlink in /usr/local/bin
instead of ~/bin
and make sure that /usr/local/bin
in in PATH
.
$ ln -s /Applications/Sublime\ Text.app/Contents/SharedSupport/bin/subl /usr/local/bin/. $ echo $PATH
If you don't find /usr/local/bin/
, then add the following lines to your .bashrc
or .zshrc:
PATH=$PATH:/usr/local/bin/; export PATH
This solved my Sublime terminal (subl
) command issue after battling for a while on Yosemite:
sudo su rm /usr/local/bin/subl ln -s "/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl" /usr/local/bin/subl exit
Here is the source.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With