From 3f3375a357e852034e398ee13b76c2f28f5de58f Mon Sep 17 00:00:00 2001 From: Evan Senter Date: Tue, 23 Dec 2025 13:54:06 +0000 Subject: [PATCH 1/4] Refactor sync to use home/ directory MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Move all syncable dotfiles into home/ directory, simplifying bootstrap.sh from an exclusion-based approach to a whitelist approach. Before: rsync with 10+ --exclude flags After: rsync home/ ~ To add new dotfiles, just put them in home/ - no script changes needed. - Move .aliases, .bin/, .exports, .gitconfig, .tmux.conf, .vim/, .vimrc, .zsh_prompt, .zshrc into home/ - Simplify sync_dotfiles() to single rsync command - Update git pull to use main branch - Update CLAUDE.md with new file paths 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- CLAUDE.md | 19 +++++++++---------- bootstrap.sh | 18 +++--------------- .aliases => home/.aliases | 0 {.bin => home/.bin}/toggle-btop-theme | 0 .exports => home/.exports | 0 .gitconfig => home/.gitconfig | 0 .tmux.conf => home/.tmux.conf | 0 .../.vim}/colors/catppuccin_mocha.vim | 0 .vimrc => home/.vimrc | 0 .zsh_prompt => home/.zsh_prompt | 0 .zshrc => home/.zshrc | 0 11 files changed, 12 insertions(+), 25 deletions(-) rename .aliases => home/.aliases (100%) rename {.bin => home/.bin}/toggle-btop-theme (100%) rename .exports => home/.exports (100%) rename .gitconfig => home/.gitconfig (100%) rename .tmux.conf => home/.tmux.conf (100%) rename {.vim => home/.vim}/colors/catppuccin_mocha.vim (100%) rename .vimrc => home/.vimrc (100%) rename .zsh_prompt => home/.zsh_prompt (100%) rename .zshrc => home/.zshrc (100%) diff --git a/CLAUDE.md b/CLAUDE.md index 69f64c3c..8cd1fcf6 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -4,7 +4,7 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co ## Repository Overview -This is a minimal macOS dotfiles repository for zsh, git, vim, and tmux. The structure is flat with all configuration files in the root directory. External themes are managed as git submodules in `vendor/`. +This is a minimal macOS dotfiles repository for zsh, git, vim, and tmux. Syncable dotfiles live in `home/` and are copied to `~` on install. External themes are managed as git submodules in `vendor/`. ## Installation and Updates @@ -46,40 +46,39 @@ The `.zshrc` file sources other configuration files in this order: ### Key Components -**Prompt System** (.zsh_prompt:23-40) +**Prompt System** (home/.zsh_prompt:23-40) - Uses zsh hooks (`preexec` and `precmd`) to track command execution time - `preexec` captures start time before command runs - `precmd` calculates elapsed time after command completes - Timer only displayed if command takes >0 seconds -**Bootstrap Process** (bootstrap.sh:76-112) -- Uses `rsync` to sync dotfiles to home directory -- Excludes git metadata, scripts, documentation, LaunchAgents, vendor, and preferences from sync +**Bootstrap Process** (bootstrap.sh:76-100) +- Uses `rsync` to sync `home/` directory contents to `~` - Installs tmux plugin manager (TPM) if not present - TPM must be manually activated in tmux with `prefix + I` after first install - Symlinks btop themes from `vendor/btop-catppuccin/` to `~/.config/btop/themes/` - Installs LaunchAgents (if dependencies are available) -**Tmux Configuration** (.tmux.conf) +**Tmux Configuration** (home/.tmux.conf) - Uses Catppuccin theme (mocha flavor) for status bar styling - Custom key bindings: `|` for horizontal split, `-` for vertical split - Vim-style pane navigation with Ctrl-hjkl - Session resurrection with `prefix + S` (save) and `prefix + Y` (restore) - Auto-saves sessions every 15 minutes via tmux-continuum -**Git Configuration** (.gitconfig) +**Git Configuration** (home/.gitconfig) - Common aliases: `st`, `co`, `br`, `ci`, `lg`, `amend`, `unstage`, `discard` - Auto setup remote on push, prune on fetch - Default branch set to `main` - Uses GitHub CLI (`gh`) for credential management -**Vim Configuration** (.vimrc) +**Vim Configuration** (home/.vimrc) - 2-space indentation with spaces (expandtab) - Incremental, case-smart search with highlighting - No swap/backup files - Line numbers and always-visible status line -**Dark Mode Theme Switching** (.bin/toggle-btop-theme) +**Dark Mode Theme Switching** (home/.bin/toggle-btop-theme) - Automatically switches btop theme based on macOS appearance - Uses catppuccin_mocha for dark mode, catppuccin_latte for light mode - Requires `dark-notify` (`brew install cormacrelf/tap/dark-notify`) @@ -97,4 +96,4 @@ The `.zshrc` file sources other configuration files in this order: ## Personal Customizations -Users can create `~/.extra` (not tracked) to add personal settings that override defaults. This file is sourced last in .zshrc:71-73. +Users can create `~/.extra` (not tracked) to add personal settings that override defaults. This file is sourced last in home/.zshrc:71-73. diff --git a/bootstrap.sh b/bootstrap.sh index c13de800..4b316ccd 100755 --- a/bootstrap.sh +++ b/bootstrap.sh @@ -8,7 +8,7 @@ cd "$(dirname "${BASH_SOURCE}")"; # Pull latest changes from remote -git pull origin master; +git pull origin main; # ============================================================================== # Functions @@ -74,26 +74,14 @@ install_btop_themes() { } sync_dotfiles() { - # Sync dotfiles to home directory + # Sync dotfiles from home/ directory to ~ rsync \ - --exclude ".DS_Store" \ - --exclude ".git/" \ - --exclude ".gitignore" \ - --exclude ".claude/" \ - --exclude "CLAUDE.md" \ - --exclude "bootstrap.sh" \ - --exclude "uninstall.sh" \ - --exclude "LICENSE-MIT.txt" \ - --exclude "README.md" \ - --exclude "LaunchAgents/" \ - --exclude "vendor/" \ - --exclude "preferences/" \ --archive \ --verbose \ --human-readable \ --force \ --no-perms \ - . ~ + home/ ~ # Install tmux plugin manager if needed install_tmux_plugin_manager diff --git a/.aliases b/home/.aliases similarity index 100% rename from .aliases rename to home/.aliases diff --git a/.bin/toggle-btop-theme b/home/.bin/toggle-btop-theme similarity index 100% rename from .bin/toggle-btop-theme rename to home/.bin/toggle-btop-theme diff --git a/.exports b/home/.exports similarity index 100% rename from .exports rename to home/.exports diff --git a/.gitconfig b/home/.gitconfig similarity index 100% rename from .gitconfig rename to home/.gitconfig diff --git a/.tmux.conf b/home/.tmux.conf similarity index 100% rename from .tmux.conf rename to home/.tmux.conf diff --git a/.vim/colors/catppuccin_mocha.vim b/home/.vim/colors/catppuccin_mocha.vim similarity index 100% rename from .vim/colors/catppuccin_mocha.vim rename to home/.vim/colors/catppuccin_mocha.vim diff --git a/.vimrc b/home/.vimrc similarity index 100% rename from .vimrc rename to home/.vimrc diff --git a/.zsh_prompt b/home/.zsh_prompt similarity index 100% rename from .zsh_prompt rename to home/.zsh_prompt diff --git a/.zshrc b/home/.zshrc similarity index 100% rename from .zshrc rename to home/.zshrc From f9bf44b5ce1bfde8cf83dbbf215f2f86507b5978 Mon Sep 17 00:00:00 2001 From: Evan Senter Date: Tue, 23 Dec 2025 13:58:53 +0000 Subject: [PATCH 2/4] Fix GitHub Actions permissions for PR comments MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Add pull-requests: write to allow gh pr comment - Add issues: write to claude.yml for issue interactions 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- .github/workflows/claude-code-review.yml | 2 +- .github/workflows/claude.yml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/claude-code-review.yml b/.github/workflows/claude-code-review.yml index 8452b0f2..ca92885d 100644 --- a/.github/workflows/claude-code-review.yml +++ b/.github/workflows/claude-code-review.yml @@ -21,7 +21,7 @@ jobs: runs-on: ubuntu-latest permissions: contents: read - pull-requests: read + pull-requests: write issues: read id-token: write diff --git a/.github/workflows/claude.yml b/.github/workflows/claude.yml index d300267f..4f24565f 100644 --- a/.github/workflows/claude.yml +++ b/.github/workflows/claude.yml @@ -20,8 +20,8 @@ jobs: runs-on: ubuntu-latest permissions: contents: read - pull-requests: read - issues: read + pull-requests: write + issues: write id-token: write actions: read # Required for Claude to read CI results on PRs steps: From 0c9a95d26835349b1533401cc111da777aabb1cd Mon Sep 17 00:00:00 2001 From: Evan Senter Date: Tue, 23 Dec 2025 14:01:19 +0000 Subject: [PATCH 3/4] Add .DS_Store exclusion to rsync MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Defense-in-depth: exclude .DS_Store from sync even though it's already in .gitignore. Prevents accidental sync if macOS creates one in home/ directory. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- bootstrap.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/bootstrap.sh b/bootstrap.sh index 4b316ccd..a6211871 100755 --- a/bootstrap.sh +++ b/bootstrap.sh @@ -76,6 +76,7 @@ install_btop_themes() { sync_dotfiles() { # Sync dotfiles from home/ directory to ~ rsync \ + --exclude ".DS_Store" \ --archive \ --verbose \ --human-readable \ From 03e5ced49921fa26836e342a7466d87a3f4e75ab Mon Sep 17 00:00:00 2001 From: Evan Senter Date: Tue, 23 Dec 2025 14:02:56 +0000 Subject: [PATCH 4/4] Update README with current features and structure MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Add submodule clone instructions (--recursive) - Document all included configs (git, vim, tmux, btop, iTerm2) - Add dark mode theme switching setup instructions - Show new home/ directory structure - Update install/update commands 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- README.md | 69 +++++++++++++++++++++++++++++++++++-------------------- 1 file changed, 44 insertions(+), 25 deletions(-) diff --git a/README.md b/README.md index 786ab2ca..38162b4e 100644 --- a/README.md +++ b/README.md @@ -1,66 +1,85 @@ # Evan's dotfiles -Minimal zsh configuration for macOS. +Minimal macOS dotfiles for zsh, git, vim, and tmux with automatic dark/light mode theme switching. ## What's included -- **Zsh configuration** - History management, completion caching, directory navigation -- **Custom prompt** - Shows directory, current time, and elapsed time for commands -- **Basic aliases** - Navigation shortcuts and colored ls/grep -- **PATH setup** - Adds `~/.local/bin` to PATH -- **Tmux config** - Basic tmux setup with plugin manager +- **Zsh** - History management, completion caching, directory navigation, custom prompt with command timer +- **Git** - Sensible defaults, common aliases (`st`, `co`, `br`, `lg`, etc.) +- **Vim** - 2-space indentation, Catppuccin theme, sensible search settings +- **Tmux** - Catppuccin theme, vim-style navigation, session persistence +- **btop** - Automatic dark/light theme switching via macOS appearance +- **iTerm2** - Catppuccin color schemes (manual import required) ## Installation -Clone the repository and run the bootstrap script: +Clone with submodules and run bootstrap: ```bash -git clone https://github.com/evansenter/dotfiles.git +git clone --recursive https://github.com/evansenter/dotfiles.git cd dotfiles ./bootstrap.sh ``` -The script will sync dotfiles to your home directory. Restart your terminal or run `source ~/.zshrc` to apply changes. +Restart your terminal or run `source ~/.zshrc` to apply changes. + +### Optional: Dark mode theme switching + +For automatic btop theme switching based on macOS appearance: + +```bash +brew install cormacrelf/tap/dark-notify +./bootstrap.sh # Re-run to install LaunchAgent +``` ## Updating -To pull the latest changes and sync: +Pull latest and sync: ```bash cd dotfiles +git pull +git submodule update --init --remote ./bootstrap.sh -f ``` ## Uninstalling -To remove all dotfiles from your home directory: - ```bash cd dotfiles ./uninstall.sh ``` +## Structure + +``` +dotfiles/ +├── home/ # Synced to ~/ on install +│ ├── .aliases +│ ├── .bin/ +│ ├── .exports +│ ├── .gitconfig +│ ├── .tmux.conf +│ ├── .vim/ +│ ├── .vimrc +│ ├── .zsh_prompt +│ └── .zshrc +├── vendor/ # Git submodules (themes) +├── preferences/ # App config backups +├── LaunchAgents/ # macOS LaunchAgent templates +└── bootstrap.sh +``` + ## Customization -Create a `~/.extra` file (not tracked by this repo) to add personal customizations without forking: +Create `~/.extra` (not tracked) for personal settings: ```bash -# ~/.extra example +# ~/.extra export CUSTOM_VAR="value" alias myalias="some command" ``` -## Features - -**Smart history search**: Type a command prefix (like `git`) and press ↑/↓ arrows to search matching commands in history. - -**Command timer**: The prompt shows how long the previous command took to run. - -**Clean prompt format**: -``` -~/path/to/directory 14:32:45 3s → -``` - ## Credits Based on [Mathias Bynens' dotfiles](https://github.com/mathiasbynens/dotfiles), heavily simplified.