My complete Zsh configuration as a Zsh plugin.
For an empty starting config that follows the same organization,
switch to the minimal
branch.
Note that versioned released are cut from the minimal
branch,
and changes between those releases are documented in the
CHANGELOG.
The master
branch represents my current Zsh environment,
and is intended to remain unversioned.
This configuration system works as a meta-plugin:
all desired Zsh plugins are loaded from plugins.zsh
using zgen.
Overall configuration then follows a normal plugin structure.
Display a quick reference of custom binds, aliases, and functions defined by this plugin with
$ zshrc
You can install this via the command-line with either curl
$ curl -L https://git.io/vJAEY | sh
or wget
$ wget https://git.io/vJAEY -O - | sh
- Install zgen to
~/.zgen.zsh/zgen.zsh
. - Create
~/.zshrc
with
# rxrc/zshrc
branch="${ZSHRC_BRANCH:-master}"
source "${HOME}/.zgen.zsh/zgen.zsh"
if [[ -d "${HOME}/.zgen/local/zshrc-${branch}" ]]; then
source "${HOME}/.zgen/local/zshrc-${branch}/plugins.zsh"
elif [[ -d "${HOME}/.zgen/rxrc/zshrc-${branch}" ]]; then
source "${HOME}/.zgen/rxrc/zshrc-${branch}/plugins.zsh"
else
zgen load rxrc/zshrc plugin $branch
zgen update
echo
echo ' ✔ Installed zshrc as zgen plugin!'
echo
echo ' ➤ Press any key to exit this shell.'
echo ' ➤ Open a new shell to finish setup.'
read -s -n 1
exit 0
fi
Updating is handled via the normal zgen update commands.
Here is an example of a Zsh function that will provide a one-step update:
# Upgrade zshrc.
function zshupg () {
if ! [[ -d $HOME/.zgen.zsh ]]; then
echo 'zgen is not installed.'
exit 1
fi
zgen selfupdate
zgen update
}
This configuration will load ~/.promptline.sh
which can be generated or updated using promptline.vim
by running :PromptlineSnapshot! ~/.promptline.sh
from Vim.
You can customize this configuration or manage your own in the same way.
- Clone or fork this.
If you prefer a clean start, clone the
minimal
branch: it has the same structure and development tools but with a very minimal configuration. Tagged releases are based on that branch. - Replace any instance of
rxrc/zshrc
with the path to your repository's location. If you do not host this on GitHub, you may need to adjust the repository path appropriately. - Customize package.json.
- Update
install.sh
on thegh-pages
branch. - Update the urls for the install script in this README.
Here is an example of a command you can use to make replacements:
$ git ls-files -z | xargs -0 sed -i 's/rxrc\/zshrc/username\/zshrc/g'
You can use Gulp to switch to development mode which will configure zgen to use the development directory as the plugin path.
First, follow the normal install steps if you haven't already. Then, install the development dependences via npm with
$ npm install
Enter development mode with
$ npm start
Switch out of development mode with
$ npm stop
Please submit and comment on bug reports and feature requests.
To submit a patch:
- Fork it (https://github.com/rxrc/zshrc/fork).
- Create your feature branch (
git checkout -b my-new-feature
). - Make changes.
- Commit your changes (
git commit -am 'Add some feature'
). - Push to the branch (
git push origin my-new-feature
). - Create a new Pull Request.
This zsh configuration is licensed under the MIT license.
This software is provided "as is" and without any express or implied warranties, including, without limitation, the implied warranties of merchantibility and fitness for a particular purpose.