Published on

Easily Split Out Custom Oh My ZSH Configs

Authors

Today I decided to install oh-my-zsh on my workstation. Originally I chose to switch back to bash as some of the tools I used did not support ZSH completions. This does not seem to be the case any more.

As part of the install I wanted to see if there was a way to separate out my aliases, completions, exports and plugins. I eventually found out that in your .zshrc you can simply specify:

ZSH_CUSTOM=$HOME/.oh-my-zsh-custom

This can be a path to anywhere to a folder called anything you want. In my case I chose to keep it more in line with how you would specify settings for other command line tools.

In this folder I created the following files:

alias.zsh  completions.zsh  exports.zsh  functions.zsh

When my .zshrc file is read these files are all sourced. This makes it easy for me to cleanly separate out my various configs. I can version control these and sym link to my version controlled files so that I can easily use this across machines. The only custom changes I still make in the .zshrc file are oh-my-zsh themes and plugins.