Launch Sublime Text 3 from the command line & simlink to Subl

  • (1 Vote)
  • Written by 
  • Tuesday, 04 December 2023 08:50

These instructions assume you’re using the Terminal app out of the box, without ZSH or any fancy prompts like that. I trust you will be able to adapt these instructions yourself if you do.

Step 1 : Create a symlink called sublime

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

Step 2 : Check that your system profile can find the symlink you just created.

open ~/.bash_profile

Step 3 : Add both these lines & then save the file :

alias subl="open -a /Applications/Sublime\ Text.app"
export PATH=/usr/local/bin:$PATH

Step 4 : Reload your bash_profile :

source ~/.bash_profile

Done ! You can now navigate to any of your code/script folders in Terminal and open them in Sublime with the following commands :

subl .
subl .zshrc
1016 Read