An open API service indexing awesome lists of open source software.

https://github.com/mrz07/multi-zsh

A micro framework to run the same zsh configuration on multiple operating systems
https://github.com/mrz07/multi-zsh

bash bash-profile zsh zsh-configuration zsh-plugin zsh-profile zsh-prompt zshell zshrc

Last synced: 7 months ago
JSON representation

A micro framework to run the same zsh configuration on multiple operating systems

Awesome Lists containing this project

README

          

# Multi-ZSH: The Ultimate Cross-Platform ZSH Configuration Framework

## πŸš€ Introduction

**Multi-ZSH** is a powerful, lightweight, and flexible framework that enables you to maintain a single, unified ZSH configuration across **Linux, macOS, and Windows**. Designed for developers, system administrators, and power users, Multi-ZSH ensures a **consistent shell experience** across all operating systems.

## πŸ”₯ Why Choose Multi-ZSH?

- βœ… **Seamless Cross-Platform Support**: Works flawlessly on **Linux, macOS, and Windows**.
- βœ… **Portable & Unified ZSH Configuration**: Manage all your shell settings from one place.
- βœ… **Customizable & Modular**: Use preloaded configurations and extend functionality with custom modules.
- βœ… **Compatible with All ZSH Frameworks**: Supports **Oh-My-Zsh, Prezto, Antigen, and Zim**.
- βœ… **Lightweight & Fast**: Minimal dependencies, designed for performance.
- βœ… **Effortless Synchronization**: Easily sync your settings via **Git, Dropbox, or cloud services**.
- βœ… **Automated Setup**: Quickly set up using the provided **symlink script**.

## πŸ—οΈ Directory Structure

```
multi-zsh/
β”œβ”€β”€ README.md # Documentation
β”œβ”€β”€ run-to-symlink.sh # Setup script to symlink .zshrc
β”œβ”€β”€ .zshrc # Main ZSH configuration file
β”œβ”€β”€ preload_configs/ # OS-specific preloaded configurations
β”‚ β”œβ”€β”€ common/ # Shared configurations
β”‚ β”œβ”€β”€ linux/ # Linux-specific configs
β”‚ β”‚ └── path.sh # Linux-specific path configurations
β”‚ β”œβ”€β”€ macos/ # macOS-specific modules
β”‚ β”‚ └── path.sh # macOS-specific path configurations
β”‚ β”œβ”€β”€ windows/ # Windows-specific configs
β”‚ β”‚ └── path.sh # Windows-specific path configurations
β”œβ”€β”€ modules/ # Custom modules (aliases, functions, etc.)
β”‚ β”œβ”€β”€ common/ # Cross-platform modules
β”‚ β”œβ”€β”€ linux/ # Linux-specific modules
β”‚ β”œβ”€β”€ macos/ # macOS-specific modules
β”‚ β”œβ”€β”€ windows/ # Windows-specific modules
```

## πŸ“¦ Installation & Setup

### 1️⃣ Clone the Repository

```bash
git clone https://github.com/yourusername/mrz07-multi-zsh.git
```

### 2️⃣ Move Your Existing ZSH Configuration
Move your existing `.zshrc` file to the framework’s root folder

### 3️⃣ Run the Setup Script
```bash
./run-to-symlink.sh
```
This script will create a **symlink** to the recently moved configuration in the framework’s root folder.

### 4️⃣ Customize Your Configuration

- Add **OS-specific** preloaded configs in `preload_configs/`
- Add **OS-specific** Environment/Path configs in `preload_configs/*os*/path.sh"`
- Extend functionality with **custom modules** in `modules/`

## βš™οΈ How Multi-ZSH Works

### **1️⃣ Dynamic Configuration Loading**
Multi-ZSH **automatically detects your operating system** and loads the appropriate configurations.

- **Common settings** (`preload_configs/common/`) are loaded first.
- **OS-specific settings** (`preload_configs/linux/`, `macos/`, `windows/`) are applied afterward.

### **2️⃣ Modular Architecture**
- Store **custom functions, aliases, and scripts** in `modules/`.
- Modules are categorized into **common** and **OS-specific** folders.
- Ignore specific modules or configurations by **prefixing folder names with `#`** (e.g., `#ignored_module/`).

### **3️⃣ Symlink-Based Setup**
- The **setup script** (`run-to-symlink.sh`) automatically links `.zshrc` to the framework.
- This allows **easy switching** between configurations without modifying system files.

## 🎯 Key Features

### πŸ”— **Cross-Platform Compatibility**
- Works seamlessly on **Linux, macOS, and Windows (WSL, Git Bash, Cygwin, MSYS2)**.

### πŸ”„ **Auto-Loading of Preloaded Configurations**
- Automatically loads common and OS-specific **aliases, functions, and environment variables**.

### 🎨 **Custom Modules & Plugins Support**
- Organize your scripts with a modular structure.
- Supports **any additional ZSH plugins or external tools**.

### 🏎️ **Optimized for Speed & Performance**
- **Lightweight** with minimal overhead.
- **Fast execution** with optimized loading logic.

### ☁️ **Sync Anywhere**
- Easily sync configurations across devices using **Git, Dropbox, or cloud services**.

### πŸ› οΈ **Works with Any ZSH Framework**
- Compatible with **Oh-My-Zsh, Prezto, Antigen, Zim, and more**.

### 🧩 **Fully Customizable**
- Add, remove, or modify configurations as needed.
- Ignore specific scripts or modules by naming them with `#`.

## πŸ› οΈ Usage

### **Adding Custom Modules**
Place your custom ZSH scripts inside the corresponding **modules/** folder:

```bash
modules/
β”œβ”€β”€ common/
β”‚ β”œβ”€β”€ aliases.sh # Shared aliases
β”‚ β”œβ”€β”€ functions.sh # Shared functions
β”‚ β”œβ”€β”€ style/
β”‚ β”‚ └── starship.toml # Custom Starship prompt config
β”œβ”€β”€ linux/
β”‚ β”œβ”€β”€ linux_aliases.sh # Linux-specific aliases
β”œβ”€β”€ macos/
β”‚ β”œβ”€β”€ macos_shortcuts.sh # macOS-specific functions
β”œβ”€β”€ windows/
β”‚ β”œβ”€β”€ win_helpers.sh # Windows-specific helpers
```

### **Ignoring Folders & Scripts**
To prevent specific scripts from being loaded, **prefix the filename or folder with `#`**:

```bash
modules/
β”œβ”€β”€ common/
β”‚ β”œβ”€β”€ aliases.sh
β”‚ β”œβ”€β”€ #deprecated_aliases.sh # This file will be ignored
β”‚ β”œβ”€β”€ #old_scripts/ # This folder will be ignored
```

## 🀝 Contributing
We welcome contributions! Feel free to submit issues, feature requests, or pull requests.

## πŸ“œ License
Multi-ZSH is open-source and available under the **MIT License**.

---

πŸ”₯ **Start using Multi-ZSH today and streamline your ZSH configuration across all platforms!** πŸš€