From 0db89f0991f93c111f279521c0b8ffd939f60f89 Mon Sep 17 00:00:00 2001 From: Jens Luedicke Date: Wed, 15 Oct 2025 17:08:31 +0200 Subject: [PATCH] Replace Oh My Zsh direct loading with Sheldon plugin manager MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Add Sheldon configuration in sheldon/plugins.toml - Configure Sheldon to manage Oh My Zsh library and plugins - Load Spaceship prompt, 14 OMZ plugins, and custom plugins via Sheldon - Simplify zshrc by moving plugin configuration to Sheldon - Keep OMZ compatibility variables for plugin functionality - Improve startup performance with Sheldon's caching Benefits: - Faster shell startup with cached plugin loading - Better dependency management through git submodules - Cleaner separation of concerns (plugins.toml vs zshrc) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- sheldon/plugins.toml | 93 ++++++++++++++++++++++++++++++++++++++++++++ zshrc | 43 ++++---------------- 2 files changed, 100 insertions(+), 36 deletions(-) create mode 100644 sheldon/plugins.toml diff --git a/sheldon/plugins.toml b/sheldon/plugins.toml new file mode 100644 index 0000000..c68697c --- /dev/null +++ b/sheldon/plugins.toml @@ -0,0 +1,93 @@ +shell = "zsh" + +[templates] +defer = "{{ hooks?.pre | nl }}{% for file in files %}zsh-defer source \"{{ file }}\"\n{% endfor %}{{ hooks?.post | nl }}" + +# Spaceship prompt - loaded first +[plugins.spaceship] +local = "~/.dotfiles/zsh/spaceship-prompt" +use = ["spaceship.zsh"] +apply = ["source"] + +[plugins.spaceship-config] +local = "~/.dotfiles/zsh" +use = ["spaceship.zsh"] +apply = ["source"] + +# Oh My Zsh library - load all lib files +[plugins.oh-my-zsh-lib] +local = "~/.dotfiles/zsh/oh-my-zsh/lib" +use = ["*.zsh"] +apply = ["source"] + +# Oh My Zsh plugins +[plugins.git] +local = "~/.dotfiles/zsh/oh-my-zsh/plugins/git" +use = ["git.plugin.zsh"] +apply = ["source"] + +[plugins.docker] +local = "~/.dotfiles/zsh/oh-my-zsh/plugins/docker" +use = ["*.zsh"] +apply = ["source"] + +[plugins.docker-compose] +local = "~/.dotfiles/zsh/oh-my-zsh/plugins/docker-compose" +use = ["*.zsh"] +apply = ["source"] + +[plugins.tmux] +local = "~/.dotfiles/zsh/oh-my-zsh/plugins/tmux" +use = ["*.zsh"] +apply = ["source"] + +[plugins.z] +local = "~/.dotfiles/zsh/oh-my-zsh/plugins/z" +use = ["*.zsh"] +apply = ["source"] + +[plugins.command-not-found] +local = "~/.dotfiles/zsh/oh-my-zsh/plugins/command-not-found" +use = ["*.zsh"] +apply = ["source"] + +[plugins.history-substring-search] +local = "~/.dotfiles/zsh/oh-my-zsh/plugins/history-substring-search" +use = ["*.zsh"] +apply = ["source"] + +[plugins.colored-man-pages] +local = "~/.dotfiles/zsh/oh-my-zsh/plugins/colored-man-pages" +use = ["*.zsh"] +apply = ["source"] + +[plugins.extract] +local = "~/.dotfiles/zsh/oh-my-zsh/plugins/extract" +use = ["*.zsh"] +apply = ["source"] + +[plugins.sudo] +local = "~/.dotfiles/zsh/oh-my-zsh/plugins/sudo" +use = ["*.zsh"] +apply = ["source"] + +[plugins.cp] +local = "~/.dotfiles/zsh/oh-my-zsh/plugins/cp" +use = ["*.zsh"] +apply = ["source"] + +[plugins.dirhistory] +local = "~/.dotfiles/zsh/oh-my-zsh/plugins/dirhistory" +use = ["*.zsh"] +apply = ["source"] + +# Custom plugins (submodules) +[plugins.zsh-autosuggestions] +local = "~/.dotfiles/zsh/custom-plugins/zsh-autosuggestions" +use = ["zsh-autosuggestions.zsh"] +apply = ["source"] + +[plugins.zsh-syntax-highlighting] +local = "~/.dotfiles/zsh/custom-plugins/zsh-syntax-highlighting" +use = ["zsh-syntax-highlighting.zsh"] +apply = ["source"] diff --git a/zshrc b/zshrc index 7b9ed01..51efd2f 100755 --- a/zshrc +++ b/zshrc @@ -124,45 +124,16 @@ fts() { # fi # } -# Oh My Zsh configuration +# Oh My Zsh compatibility settings (for OMZ plugins) export ZSH="$HOME/.dotfiles/zsh/oh-my-zsh" +export ZSH_CACHE_DIR="$HOME/.cache/oh-my-zsh" +mkdir -p "$ZSH_CACHE_DIR/completions" -# Use Spaceship prompt (already configured as submodule) -# ZSH_THEME is not needed when using external prompt like Spaceship -ZSH_THEME="" +# Sheldon plugin manager +export SHELDON_CONFIG_FILE="$HOME/.dotfiles/sheldon/plugins.toml" -# Oh My Zsh settings -CASE_SENSITIVE="false" -HYPHEN_INSENSITIVE="true" -DISABLE_AUTO_UPDATE="true" # Managed via git submodule -DISABLE_UPDATE_PROMPT="true" -ENABLE_CORRECTION="true" -COMPLETION_WAITING_DOTS="true" -HIST_STAMPS="yyyy-mm-dd" - -# Plugins -plugins=( - git - docker - docker-compose - tmux - z - command-not-found - history-substring-search - colored-man-pages - extract - sudo - cp - dirhistory - zsh-autosuggestions - zsh-syntax-highlighting # Must be last -) - -source $ZSH/oh-my-zsh.sh - -# Load Spaceship prompt -source ~/.dotfiles/zsh/spaceship-prompt/spaceship.zsh -source ~/.dotfiles/zsh/spaceship.zsh +# Cache Sheldon plugins for faster startup +eval "$(sheldon source)" # Plugin customizations # zsh-autosuggestions