Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Sublime Text 3 and Terminal prompt for OS X Mavericks?

People also ask

How do I run Sublime Text from Terminal 3?

Type 'Terminus' and select it. Wait for it to Complete installation and Restart sublime text. And save it. Note: The above code is for Linux users for Windows users you have to enter “cmd.exe” in place of “bash”, also here we kept the shortcut key as “alt+1” you can use your own key.

Does Sublime Text have a terminal?

Sublime by default does not have terminal integrated. Terminus is a cross-platform terminal for sublime. To install Terminus – COMMAND PALLET [ CTRL + SHIFT + P ] → INSTALL PACKAGE → TERMINUS.


Should be:

ln -s "/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl" /usr/local/bin/sublime

Notice I removed the tilde (~). Tilde (~) in Unix refers to your user's home directory, so your source was correct, but the second argument was placing the link in /Users/[your username]/usr/local/bin/ which is not included in $PATH.

In your note, you said you tried removing the quotes from the source argument. If you remove the quotes, you need to be sure to escape the space character as follows:

ln -s /Applications/Sublime\ Text.app/Contents/SharedSupport/bin/subl /usr/local/bin/sublime

That should work as well.


Mavericks does not ship with a ~/bin directory, but found I ran into trouble trying to install the subl command in any of the low-level system bin directories. I found the following solution worked neatly:

Create a ~/bin directory for your user:

mkdir ~/bin

Add the subl command as per the Sublime Text documentation:

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

Open /etc/paths in your (second) favourite text editor:

sudo vi /etc/paths

Add the active user's ~/bin folder. Here's how mine looked after I'd added ~/bin:

~/bin
/usr/bin
/bin
/usr/sbin
/sbin
/usr/local/bin

Rather than having cumbersome sudo links to setup I prefer to use a simple bash function and use the native Mac open command:

#somewhere in your .bashrc or .zshrc
sublime () {
    open -a "Sublime Text" $@
}

Now all you have to do is sublime . whenever you want to open up sublime from a given folder. Obviously you can simply rename it subl.

Note The name to write in the -a parameter is the name of the application as stored in the the /Applications folder:

enter image description here


After a few days of struggling with the issue, this worked for me.

Make sure you have ~/usr/bin set in $PATH

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

If you get a permission denied error:

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

Type in your password.


This works for me as well:

sudo ln -s "/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl" /usr/local/bin/st

Than you can write just:

st filename.file extension

It should works. I tried so many things but this worked first.