/zsh-chezmoi

Add completion and aliases for chezmoi to make managing dotfiles easier

Primary LanguageShellMIT LicenseMIT

zsh-chezmoi

Add completion and aliases for chezmoi.

Detects if you have any git aliases (i.e. from oh-my-zsh) and dynamically creates chezmoi aliases for them.

Installation

Using oh-my-zsh, clone into $ZSH_CUSTOM/plugins/chezmoi:

git clone https://github.com/mass8326/zsh-chezmoi.git $ZSH_CUSTOM/plugins/chezmoi

Then add chezmoi after git to your plugins array:

 plugins=(
   ...
   git
+  chezmoi
   ...
 )

Usage

zsh-chezmoi adds several aliases to make managing your dotfiles quick and easy.

Utilities

Alias Command Desc
ch chezmoi Run chezmoi
chd chezmoi diff Print diff between your source and target
chcd chezmoi cd Spawn shell in chezmoi source directory
chst chezmoi status Show changed files between source and target

Editing Source

Alias Command Desc
cha chezmoi add Add file from target to source
chr chezmoi re-add Import changes from target to source
che chezmoi edit Edit chezmoi source using your $EDITOR
chea chezmoi edit --apply Edit chezmoi source then apply to target

Updating Target

Alias Command Desc
chap chezmoi apply Apply source changes to your target
chud chezmoi update Pull from remote and apply changes to target

Git

zsh-chezmoi also detects any git aliases that start with g and adds the corresponding alias for chezmoi git. For this to happen, the alias must exist before zsh-chezmoi is instantiated.

Alias Command
chga chezmoi git -- add
chgaa chezmoi git -- add --all
chgst chezmoi git -- status
chgc chezmoi git -- commit
chgp chezmoi git -- push
chg[...] chezmoi git -- [...]