Shell customizations that make my life easier
The latest version of macOS (Catalina) includes
zsh by default instead of
bash. I’ve been using
zsh for many years and along the way I’ve started using a handful of tools that make me more productive in my terminal.
asdf (version manager)
asdf is a plugin-based version manager. For example, instead of using
nvm to manage node versions and
rvm to manage ruby versions, you can use
asdf to manage everything in one tool.
➜ ~ asdf plugin-add python ... ➜ ~ asdf list-all python ... 3.8-dev 3.8.1 3.8.2 3.9.0a4 3.9-dev ... ➜ ~ asdf install python 3.8.1
To see all the plugins
➜ ~ asdf plugin list all
z is a tool that allows you to jump around to directories you’ve accessed based on ‘frecency’ – how frequent and recent you’ve visited that directory.
Once you’ve visited several directories and start building a database of your visited directories you can simply type
z <regexes...> to jump there.
I work at Rally Health. We have a repository naming scheme that usually goes something like
<product name>-<service name>.
We may have many services for each product, depending on what product team you’re on. You can imagine there might be overlap between service names, e.g. different products have different
z and its support of multiple regexes I can do something like this:
z product-i-work-on user and it’ll be able to jump to that specific directory.
fzf is a fuzzy finder you can install for your shell.
Once you’ve installed and set it up with your shell, you can hit
Ctrl-r and get a fuzzy search of your shell’s history.
Or you can use
Ctrl-t to fuzzy find files.
fzf makes searching through my shell history much easier.
bat is like an enhanced
cat command. You can
bat files like you would use
cat and get syntax highlighting:
It’s quick to install and easy to alias
fd is a better
find command. I cannot remember how to use the
find command to save my life, so I use
fd instead. It’s fast and is more user friendly.
A feature I like is it respects your
.gitignore by default.
You can also combine
fzf to get fuzzy finding!
ripgrep is like the silver searcher but faster.
rg a lot to search through a lot of my company’s code. It makes me super productive to be able to quickly find examples of how certain internal libraries are used.
fd, it reads your
.gitignore by default which is nice. You won’t accidentally
rg through compiler output or logs that you might have ignored.
Oh my zsh
Oh my zsh is a framework that helps you customize and install plugins for
zsh. It has plugins for many of the tools I’ve mentioned above.
I want to call out the
kubectl plugin that I personally use.
It provides aliases for
kubectl commands so you save a lot of typing when using Kubernetes.
Here are some other resources you can use to draw inspiration from and customize your terminal experience. I highly recommend awesome-shell to get a taste of what tools exist.