DEV Community

mlevesquedion
mlevesquedion

Posted on

The most important alias

You may have heard of shell aliases. In short, alias is a shell command that defines a substitution, e.g. with alias clip='xclip -selection clipboard' you can type clip in a command and it will be replaced by the part on the right.

I believe aliases are key to a productive and enjoyable command line experience. They are cheap to create and maintain, and they save you a lot of typing.

To me, one alias matters more than any other: alias zc='vim ~/.zshrc'. (feel free to replace vim with your favorite $EDITOR, and .zshrc with your favorite $SHELL).

With this alias, you can improve your development workflow in a snap. Just entered the same command three times in the last five minutes? Open a terminal, enter "zc", alias it, and enjoy.


The actual alias I use is vim -n $ZSHRC; source $ZSHRC. That way my changes are applied immediately upon exiting the file.

For more, see my dotfiles.

Top comments (0)