Zsh and Antibody
In this post, I’ll introduce zsh, an alternative shell to bash that offers high customizability and tons of helpful features, especially if you spend a lot of time in the terminal.
Installing zsh and Setting It as Your Default Shell
Install zsh:
| |
Set zsh as your default shell:
| |
Customizing zsh
Out of the box, zsh is just a regular shell like bash, but once customized, it turns into a “super shell” :v
If you’re a power user, you can hand-craft your own configuration and scripts to customize zsh however you like. Since I’m not at that level, I’ll introduce the popular oh-my-zsh framework along with the antibody plugin manager. Back in the day people used antigen, but antigen is no longer actively developed, and antibody is touted as a much faster replacement (even though I find integrating oh-my-zsh with antibody a bit clunkier than with antigen). You can check out their official repositories for more details:
- https://
github .com/ robbyrussell/ oh-my-zsh - https://
github .com/ getantibody/ antibody - https://
github .com/ zsh-users/ antigen
To install antibody on Arch:
| |
(this is listed right on their official homepage^^, so the source is trustworthy)
Configuring antibody: Here I’ll cover the basics. Just as bash uses ~/.bashrc, zsh uses ~/.zshrc as its configuration file. However, antibody recommends listing your plugins in a separate file—such as ~./.zsh_plugins.txt—and then loading them using either static or dynamic loading.
Here’s an example of my ~./.zsh_plugins.txt file:
| |
This is just an example—keep in mind that some plugins require extra CLI tools to be installed before they’ll work. Now onto loading them. In short, static loading means running antibody to generate a single static script file (like config.sh).
For example: antibody bundle < ~/.zsh_plugins.txt > ~/.zsh_plugins.sh
Then in ~/.zshrc, you just add the line: source ~/.zsh_plugins.sh.
Static loading is faster than dynamic loading, but it doesn’t automatically update plugins when updates are available. That’s why I prefer dynamic loading—it’s barely any slower in practice (and still faster than antigen), while keeping things updated automatically (it checks each time it runs). Just add the following to your ~/.zshrc:
| |
Because I use Oh-My-Zsh and antibody doesn’t natively set $ZSH for it, that first export ZSH=... line is required (whereas antigen only needed antigen use oh-my-zsh). Loading Oh-My-Zsh plugins in antibody is also a bit more verbose :/ since you have to write out each line in full (I don’t know if there’s a shorter way because I was too lazy to check, and with VS Code’s multi-cursor editing it took no time at all anyway—no need to waste brainpower :v).
If you don’t want to bother with manual customization, you can install Arch’s grml-zsh-config package instead:
| |
This package configures your zsh to work just like the shell inside the official Arch installation ISO.
However, if you want to customize zsh yourself later, you should remove grml-zsh-config because it conflicts with custom themes—you can work around it, but it’s a hassle, so it’s easier to just uninstall it :v
Bye for now, and see you in the next post!^^
Comments