Just have a quick question on how to add an alias for SublimeText to my ZSH. I've been to their site where they tell you how to do it within bash, but I don't understand how to do it within ZSH. It has been killing me, I just want to open text files from my command prompt. Anyone out there have experience with ZSH where they have created aliases?
Asked
Active
Viewed 2.0k times
3 Answers
20
Aliases in zsh
are created in the same manner as in bash
.
alias somealias='something longer'
Now somealias will expand to 'something longer' (without the quotes). Put it into ~/.zshrc
to make it persistent.

Thor
- 45,082
- 11
- 119
- 130
-
Thanks, much appreciated. Placed them in my ~/.zshrc – saltex Sep 17 '12 at 23:13
-
11To be more specific, `alias subl="'/Applications/Sublime Text 2.app/Contents/SharedSupport/bin/subl'"` – Jedidja Jun 06 '15 at 19:53
2
Here is an example how to add subl
command for ZSH
Here is another example how to make UNIX EDITOR env var to use Sublime and behave well e.g. when editing subversion and git commit messages
https://github.com/miohtama/ztanesh/blob/master/zsh-scripts/rc/39-osx-vars#L11
https://github.com/miohtama/ztanesh/blob/master/zsh-scripts/bin/subl-wrapper

Mikko Ohtamaa
- 82,057
- 50
- 264
- 435
0
Just make an alias in ~/zshrc
Add this:
alias subl="'/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl'"
Then when you are in the right folder, you can always type subl .
to open that folder with Sublime

Seba Cervantes
- 199
- 1
- 7