1

I have installed zsh and ohmyzsh. I followed an instruction to open sublime text 3 on the commandline by typing sublime in the folder. Instead of typing the whole 'sublime' word, can I just open it by typing 'subl' to open sublime? If so how on ohmyzsh?

When I execute echo $PATH, it returns /usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin

Thank you in advance for helping out.

********************Edited******************** For those who are having issues try the EASY way. Fidner go to the root dir Application find sublime right click 'show content' contents/sharedSupport/bin ==> there should be a file 'subl'

now go back to root dir and usr/local/bin and look for subl or sublime. delete those and paste the recently copied subl.

Should work like a charm.

DevBear15
  • 219
  • 4
  • 15
  • tried ln -s "/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl" ~/bin/subl it doesn't work either. – DevBear15 Jan 08 '16 at 14:40
  • In /Applications/Sublime Text.app/Contents/SharedSupport/bin, there is a file subl. Why is that it is opening when i type 'sublime' ? and not 'subl .' – DevBear15 Jan 08 '16 at 14:44

3 Answers3

2

I think you're looking for a way to set an alias in zsh: https://askubuntu.com/questions/31216/setting-up-aliases-in-zsh

Community
  • 1
  • 1
1

Create a symlink from Sublime binary to /usr/local/bin. Symlink can be any name

Yerken
  • 1,944
  • 1
  • 14
  • 18
1

This worked for me. I followed the path to where sublime was located in my /Applications directory and created a symbolic link to my local executable programs. It should work for you too. If /Applications/Sublime Text.app/Contents/SharedSupport/bin/ does not lead to subl than it will not work. You might need to sudo to cd and to ln -s.

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

I found this information from this StackOverflow Question. Also, this Unix answer helped me understand the /usr/local/bin/ path better. This answer is great too. I hope it helps.

Community
  • 1
  • 1
sjgallen
  • 239
  • 3
  • 8