Zsh with Zgen

In my previous post, I've been talking about setting up Babun in Windows environment. One of the main reason to use Babun shell was the available sensible default settings for Zsh shell through oh-my-zsh framework and abundant plugins.

Initially I tried configured Zsh using Antigen based on the post by mgdm. While the tmux can start automatically every time a new session was started, the Zsh can't find the antigen-* functions. Hence, I've decided to switch the Zsh framework to Zgen instead.

First thing first, you will need to switch your current shell from Bash to Zsh. Logout and login again (I can't find any other ways besides this) to reflect the changes.
$ chsh -s `which zsh`

Since my dotfiles repository already existed, hence I only need to add Zgen as Git submodule.
$ mkdir $HOME/.zsh.d
$ cd $HOME/.zsh.d
$ git submodule add https://github.com/tarjoilija/zgen

The next step was to setup Zsh config file, `$HOME/.zshrc` with Zgen.
source $HOME/.zsh.d/zgen/zgen.zsh

ZSH_TMUX_AUTOSTART=true

# If the init script doesn't exist
if ! zgen saved; then
    zgen oh-my-zsh
    zgen oh-my-zsh plugins/tmux

    # Generate the init script from plugins above.
    zgen save
fi

Refresh the Zsh's settings.
$ source $HOME/.zshrc

No comments:

Post a Comment