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: 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/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. diff --git a/bootstrap.sh b/bootstrap.sh index c13de800..a6211871 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,15 @@ 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