Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Adding an alias for Sublime Text to zshrc

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?

like image 443
saltex Avatar asked Sep 08 '12 21:09

saltex


People also ask

How do I add an alias to Zshrc?

To set up a simple alias, edit the ~/. zshrc file using your text editor and add an alias at the bottom. It is good to keep all your aliases in a single section of the file to avoid confusion and ease of edit. alias ginit="git init ."

Where do I put ZSH aliases?

The . zshrc file exists in the user home directory where ZSH aliases are configured. These aliases are loaded automatically when the shell starts, but you can force them to reload through sourcing the . zshrc file.


1 Answers

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.

like image 154
Thor Avatar answered Oct 11 '22 11:10

Thor