Home

Awesome

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.

Status

AliasCommandDesc
chchezmoiSimple alias for chezmoi
chdchezmoi diffPrint diff between your source and target
chstchezmoi statusShow changed files between source and target
chdocchezmoi doctorChecks for common problems

Editing Source

AliasCommandDesc
chachezmoi addAdd file from target to source
chrchezmoi re-addImport changes from target to source
chechezmoi editEdit chezmoi source using your $EDITOR
cheachezmoi edit --applyEdit chezmoi source then apply to target
chcdchezmoi cdSpawn shell in chezmoi source directory

Updating Target

AliasCommandDesc
chapchezmoi applyApply source changes to your target
chupchezmoi updatePull from remote and apply changes to target
chugchezmoi upgradeUpgrade chezmoi to the latest version

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.

AliasCommand
chgachezmoi git -- add
chgaachezmoi git -- add --all
chgstchezmoi git -- status
chgcchezmoi git -- commit
chgpchezmoi git -- push
chg[...]chezmoi git -- [...]