Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/claude-code-review.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: read
pull-requests: write
issues: read
id-token: write

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/claude.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
19 changes: 9 additions & 10 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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`)
Expand All @@ -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.
69 changes: 44 additions & 25 deletions README.md
Original file line number Diff line number Diff line change
@@ -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.
17 changes: 3 additions & 14 deletions bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
cd "$(dirname "${BASH_SOURCE}")";

# Pull latest changes from remote
git pull origin master;
git pull origin main;

# ==============================================================================
# Functions
Expand Down Expand Up @@ -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
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading