An Intro to zsh-utils

ZSH is an extremely powerful tool which can be extremely useful but hard to configure. zsh-utils aims to fix this. It’s a small configuration framework which aims to provide a base to work off of without getting in your way if you want to go deeper later.

Why Use a Config Framework?

If you’ve ever started zsh without a config file before, you’ve probably seen the following mass of text before:

Please pick one of the following options:

(1)  Configure settings for history, i.e. command lines remembered
     and saved by the shell.  (Recommended.)

(2)  Configure the new completion system.  (Recommended.)

(3)  Configure how keys behave when editing command lines.  (Recommended.)

(4)  Pick some of the more common shell options.  These are simple "on"
     or "off" switches controlling the shell's features.

(0)  Exit, leaving the existing ~/.zshrc alone.

(a)  Abort all settings and start from scratch.  Note this will overwrite
     any settings from zsh-newuser-install already in the startup file.
     It will not alter any of your other settings, however.

(q)  Quit and do nothing else.
--- Type one of the keys in parentheses ---

Even after using ZSH for multiple years, if I see this, it’s rare that I take the time to go through this process every time: it’s daunting and almost every time you’ll end up with a config file that’s different on each of your computers, leading to tons of frustration.

That’s where I see the main advantages of a config framework: providing a much better out of the box ZSH experience and providing a base to build a personal config off of.

What Is This?

Taken from the project README, zsh-utils is “a minimal set of ZSH plugins designed to be low-friction and low-complexity.”

After getting frustrated with the maintenance of prezto and oh-my-zsh, I decided to write my own small config framework, in a similar vein to some of the starter kits.

Why Another Framework?

There were a number of main problems I noticed during my time maintaining prezto:

That being said, there are a number of strengths to large configuration frameworks as well.

These are not really something I’m looking for. I want to use a shell as a shell and keep everything as simple as possible so it doesn’t get overwhelming.

Ok, So Why This One?

This project aims to solve some of the problems faced by larger frameworks by focusing on the following clear goals:

Each plugin has a focused purpose:

That’s it! There are no plugins for programming languages. There are no custom formats. And there is no configuration outside loading the plugins and optionally overriding ZSH settings.

Sounds Great! How Do I Start?

If this is something that sounds useful to you, it’s fairly easy to get started.

Simply replace your .zshrc with the following snippet. This is copied directly from the setup in the zsh-utils README.

It downloads antigen, a simple plugin manager, straight from the source if it doesn’t exist and loads all the zsh-utils plugins along with a few other commonly used external plugins.

[[ ! -d "$HOME/.antigen" ]] && git clone https://github.com/zsh-users/antigen.git "$HOME/.antigen"
source "$HOME/.antigen/antigen.zsh"

# Set the default plugin repo to be zsh-utils
antigen use belak/zsh-utils

# Specify completions we want before the completion module
antigen bundle zsh-users/zsh-completions

# Specify plugins we want
antigen bundle editor
antigen bundle history
antigen bundle prompt
antigen bundle utility
antigen bundle completion

# Specify additional external plugins we want
antigen bundle zsh-users/zsh-syntax-highlighting

# Load everything
antigen apply

# Set any settings or overrides here
prompt belak
bindkey -e

Alternatively, my dotfiles are a good resource and starting point.

Now What?

Just use ZSH! If you have any problems, feel free to file an issue or open a pull request if you’re feeling up for it.

Discussion

Want to talk more about this? There are discussion threads at the following locations:

Thanks for reading!