Launch Sublime Text 3 from Command Line


Step 1: Create a bin folder in home directory

mkdir ~/bin

Step 3: Create a Symlink of the subl CLI

ln -s "/Applications/Sublime" ~/bin/subl

 Step 3: Add the bin path to your $PATH environment variable

Open .zshrc and add the absolute bin path:

export PATH="/Users/travisluong/bin:$PATH"

The relative ~/bin path doesn’t work with zsh. It works with an absolute path.

Step 4: Make subl the default EDITOR

Add this to .zshrc:

export EDITOR='subl'

Step 5: Restart iTerm2

You should be good to go.