Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Subl command not working - command not found

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?

like image 605
HectorOfTroy407 Avatar asked Aug 06 '14 05:08

HectorOfTroy407


People also ask

What is SUBL command?

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.

What does SUBL do in terminal?

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.

How do I open Sublime Text Editor in Git bash?

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.


2 Answers

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 
like image 181
Sarbbottam Avatar answered Sep 18 '22 22:09

Sarbbottam


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.

like image 20
Babavalibob Avatar answered Sep 19 '22 22:09

Babavalibob