An alias for your aliases
Tiny helper for the lazy dev
ok, first some context:
I set out to learn react from this video tutorial. The first step was to create a new directory to put the new code in.
I navigated to my code directory using my good old go2code alias, and created a new folder called learn_react. Staying true to character my next instinct was to create an alias called go2react so that I can reduce my nav friction; lol
That being said, I feel lazy every time I want to create a new alias.
I kind of wished that there was something as simple as createalias aliasname command that I could use.
So that’s what I did.
Here’s how you can set it up too.
Assumptions:
you know your way around the terminal, you use oh-my-zsh and do not wish to clutter your .zshrc file with individual aliases :P
If you use bash, feel free to modify the script.
Step 1:
Create a new file called .aliases if you don’t already have one
$ cd
$ touch ~/.aliases
Step 2:
Create a new file called .helper to keep all your helper functions
$ touch ~/.helper
Step 3:
Note: GPT wrote the function
Open the .helper file in your editor of choice and add the following code.
Code looks ugly on Substack. Here’s the link to gist with the code.
Step 4:
Source your .aliases and .helper files in your .zshrc file. I added this as the first two lines in the file.
# Load personal helper functions
source $HOME/.helper
#Load aliases
source $HOME/.aliases
Step 5:
If you already have a terminal open, then source your .zshrc file, or just open a new terminal window and start using the alias.
Here’s how I used it
$ source ~/.zshrc
$ makealias “go2react” “cd folder/path”
that’s all folks
btw, did you know that Oberyn Martell from GoT is Pedro Pascal? I had no idea, TIL.
Fin.



Cool stuff. On a slightly related note, if your aliases mostly revolve around switching directories, highly recommend trying out fzf + zoxide
fzf is a fuzzy finder so you can search for things in a fuzzy way and has been really good to recall commands where I know small portions of it.
https://github.com/junegunn/fzf
zoxide is a "smarter" way of using cd so that you don't have to type the whole path, for ex `z proj1` will jump to proj1 directory from wherever you are
https://github.com/ajeetdsouza/zoxide