Home

Awesome

zshrc-sync

A zsh plugin that automatically detects changes to the .zshrc file and syncs it to the GitHub repository when zsh exits.

Features

Installation

  1. Ensure that Git is installed.

  2. Set the following variables in your .zshrc file:

    • ZSHRC_REPO_URL: The URL of your GitHub repository.
    • ZSHRC_FILE_PATH: The full path to your .zshrc file.

    For example:

    export ZSHRC_REPO_URL='git@github.com:usename/myzshrc.git'
    export ZSHRC_FILE_PATH="$HOME/.zshrc"
    
  3. Install the plugin using zplug:

    zplug "Skylor-Tang/zshrc-sync", use:zshrc-sync.zsh, from:github, at:main
    
  4. Reload the zsh configuration file:

    source ~/.zshrc
    

Usage

The plugin will automatically detects changes to the .zshrc file and syncs it to the GitHub repository when zsh exits.

You can manually call the sync_zshrc() function to immediately sync the .zshrc file.

Notes

License

This project is licensed under the MIT License.