From 8380c08733b2ebb07d4f7cdf16bcc6ba62253850 Mon Sep 17 00:00:00 2001 From: Nick Sullivan Date: Sat, 27 Dec 2025 14:22:25 -0800 Subject: [PATCH 1/6] =?UTF-8?q?=E2=9C=A8=20Add=20modern=20CLI=20tools=20to?= =?UTF-8?q?=20Brewfile?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - btop: Modern process viewer (better htop) - delta: Beautiful git diffs with syntax highlighting - fzf: Fuzzy finder for files, history, and everything 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- Brewfile | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Brewfile b/Brewfile index 041259d..6dcf2c3 100644 --- a/Brewfile +++ b/Brewfile @@ -12,8 +12,11 @@ cask "zoom" # Command line brew "bat" +brew "btop" # Modern process viewer +brew "delta" # Beautiful git diffs +brew "fzf" # Fuzzy finder for everything brew "pkg-config" -brew "the_silver_searcher" # ag +brew "the_silver_searcher" # ag brew "pwgen" brew "watch" brew "wget" From 471edd3c3d3d9229edc05a9a1f4da85a619d1d6f Mon Sep 17 00:00:00 2001 From: Nick Sullivan Date: Sat, 27 Dec 2025 14:23:39 -0800 Subject: [PATCH 2/6] =?UTF-8?q?=E2=9C=A8=20Add=20.zshrc.local=20override?= =?UTF-8?q?=20pattern?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Support machine-specific shell customizations without committing secrets. Create ~/.zshrc.local for local-only configurations that stay out of git. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- .gitignore | 1 + .my_mac_zshrc | 3 +++ 2 files changed, 4 insertions(+) diff --git a/.gitignore b/.gitignore index b428592..0645844 100644 --- a/.gitignore +++ b/.gitignore @@ -2,4 +2,5 @@ .homedir_last_update .homedir_no_update .vim/.netrwhist +.zshrc.local Brewfile.lock.json diff --git a/.my_mac_zshrc b/.my_mac_zshrc index d89ce61..26d08fc 100644 --- a/.my_mac_zshrc +++ b/.my_mac_zshrc @@ -253,3 +253,6 @@ clone-cryptoai() { echo "✨ Ready to work in $target_dir" } + +# Source local overrides (machine-specific, not in git) +[[ -f ~/.zshrc.local ]] && source ~/.zshrc.local From 41ba48fb76b57a72978a8932bc46822448cb8562 Mon Sep 17 00:00:00 2001 From: Nick Sullivan Date: Sat, 27 Dec 2025 14:24:25 -0800 Subject: [PATCH 3/6] =?UTF-8?q?=E2=9C=A8=20Add=20.macos=20script=20for=20s?= =?UTF-8?q?ystem=20preferences?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Configure macOS defaults: - Screenshots saved to ~/Desktop/ScreenShots/ - Enable key repeat for VS Code (vim j/k) - Enable key repeat for Cursor (vim j/k) Script is idempotent and safe to run multiple times. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- .macos | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100755 .macos diff --git a/.macos b/.macos new file mode 100755 index 0000000..5d8162e --- /dev/null +++ b/.macos @@ -0,0 +1,43 @@ +#!/usr/bin/env bash + +# macOS System Preferences +# Run this script to configure macOS defaults after a fresh install. +# Safe to run multiple times (idempotent). +# +# Inspired by https://github.com/mathiasbynens/dotfiles/blob/main/.macos + +# Close any open System Preferences panes to prevent them from overriding settings +osascript -e 'tell application "System Preferences" to quit' + +# Ask for the administrator password upfront +sudo -v + +# Keep-alive: update existing `sudo` time stamp until script has finished +while true; do sudo -n true; sleep 60; kill -0 "$$" || exit; done 2>/dev/null & + +############################################################################### +# Screenshots # +############################################################################### + +# Create screenshots folder on Desktop +mkdir -p ~/Desktop/ScreenShots + +# Save screenshots to the ScreenShots folder +defaults write com.apple.screencapture location ~/Desktop/ScreenShots + +############################################################################### +# Keyboard - Vim Key Repeat # +############################################################################### + +# Enable key repeat for VS Code (so j/k work properly in vim mode) +defaults write com.microsoft.VSCode ApplePressAndHoldEnabled -bool false + +# Enable key repeat for Cursor (so j/k work properly in vim mode) +defaults write com.todesktop.230313mzl4w4u92 ApplePressAndHoldEnabled -bool false + +############################################################################### +# Kill affected applications # +############################################################################### + +echo "Done. Some changes require a logout/restart to take effect." +echo "Restart affected apps (VS Code, Cursor) for key repeat changes." From a2da1690c695d6835037a8176d640cdbd03621c9 Mon Sep 17 00:00:00 2001 From: Nick Sullivan Date: Sat, 27 Dec 2025 14:25:26 -0800 Subject: [PATCH 4/6] =?UTF-8?q?=F0=9F=93=9D=20Overhaul=20README=20with=20c?= =?UTF-8?q?omprehensive=20documentation?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Document all shell configurations - Add CLI tools table with new additions - Document .macos script and its settings - Add customization section with .zshrc.local pattern - Document smart git functions and automation - Include file structure overview 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- README.md | 149 +++++++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 137 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index 1afe4d0..8bb5000 100644 --- a/README.md +++ b/README.md @@ -1,23 +1,148 @@ -# Overview +# homedir -These are for common files in my home directory. +My macOS dotfiles. Simple, symlink-based configuration for a productive development environment. ## Install ```bash - cd ~ - git clone https://github.com/TechNickAI/homedir.git - cd homedir +cd ~ +git clone https://github.com/TechNickAI/homedir.git +cd homedir +git submodule init +git submodule update +bash setup.sh +``` + +Or as a one-liner: + +```bash +curl "https://raw.githubusercontent.com/TechNickAI/homedir/master/install.sh" | bash +``` + +After installing, run the macOS defaults script: + +```bash +~/.macos +``` + +## What's Included + +### Shell Configuration + +- **`.my_mac_zshrc`** - macOS-specific zsh config with Homebrew, virtualenv aliases, and utilities +- **`.my_zshrc`** - Cross-platform zsh base config +- **`.zshenv`** - Universal environment setup (virtualenvwrapper, Python paths) +- **`.profile`** - Bash config with history management and git aliases +- **`.bash_prompt`** - Colorized prompt with git status + +### Vim + +- **`.vimrc`** - Vim configuration with Pathogen plugin manager +- Plugins: Syntastic, CtrlP, indent guides, rainbow parentheses +- 160-char line width with visual guide + +### Git + +- **`.gitconfig`** - Safe defaults: `pull.ff=only`, rebase on pull, autocorrect +- **`.gitignore`** - Global ignore patterns + +### Code Quality + +- **`.pre-commit-config.yaml`** - Pre-commit hooks with Ruff for Python +- **`.prettierrc`** - Prettier config (88-char width, consistent with Python) +- **`.jshintrc`** - JavaScript linting + +### Command-Line Tools (via Brewfile) + +```bash +brew bundle --file=~/homedir/Brewfile +``` + +| Tool | Purpose | +|------|---------| +| `bat` | Better `cat` with syntax highlighting | +| `btop` | Modern process viewer | +| `delta` | Beautiful git diffs | +| `fzf` | Fuzzy finder for everything | +| `ag` | Fast code search (silver searcher) | +| `ncdu` | Disk usage analyzer | + +### macOS Defaults (`.macos`) + +Run `~/.macos` to configure: + +- Screenshots saved to `~/Desktop/ScreenShots/` +- Key repeat enabled for VS Code (vim j/k navigation) +- Key repeat enabled for Cursor (vim j/k navigation) + +### Automation + +**Daily Updates** (`daily_update_mac.sh`) + +Scheduled via cron to run at 10am: +- Updates Homebrew packages +- Updates npm/pnpm globals +- Skips when on battery + +```bash +# Add to crontab +0 10 * * * $HOME/homedir/daily_update_mac.sh >> $HOME/daily_update.log 2>&1 +``` + +**Environment Loading** + +Automatically sources `.env` files from: +- `~/dot_env_shared` (team-shared) +- `~/dot_env_local` (local secrets) +- `~/env`, `~/src/env`, `~/.env` + +Use `browse_env_vars` to see loaded variables. + +### Smart Git Functions + +**`commit_link`** - Copy GitHub URL of latest commit to clipboard + +**`_smart_git_update`** - Intelligent branch management: +- Detects uncommitted changes (stays on branch) +- Checks for unpushed commits (warns before switching) +- Auto-switches to main if current branch is merged + +**`clone-carmenta [name]`** / **`clone-cryptoai [name]`** - Clone project with environment setup + +## Customization + +### Local Overrides + +Create `~/.zshrc.local` for machine-specific settings. This file is gitignored and sourced at the end of `.my_mac_zshrc`: + +```bash +# ~/.zshrc.local example +export WORK_API_KEY="secret" +alias deploy="./scripts/deploy-prod.sh" +``` + +### Adding macOS Defaults - # Update the submodules (vim plugins) - git submodule init - git submodule update +Edit `.macos` to add your preferred system settings. Check [mathiasbynens/dotfiles](https://github.com/mathiasbynens/dotfiles/blob/main/.macos) for inspiration. - # Makes all the symlinks to homedir - bash setup.sh +## Structure +```text +homedir/ +├── .macos # macOS system preferences +├── .my_mac_zshrc # macOS shell config +├── .my_zshrc # Cross-platform shell config +├── .vimrc # Vim configuration +├── .vim/ # Vim plugins (Pathogen) +├── .gitconfig # Git configuration +├── .pre-commit-config.yaml +├── .prettierrc +├── Brewfile # Homebrew packages +├── setup.sh # Creates symlinks +├── daily_update_mac.sh # Automated updates +└── install.sh # One-liner installer ``` -or as a one-liner: +## License -`curl "https://raw.githubusercontent.com/TechNickAI/homedir/master/install.sh" | bash` +MIT From 0b310e494b895150e41a685769409c047bea501b Mon Sep 17 00:00:00 2001 From: Nick Sullivan Date: Sat, 27 Dec 2025 14:46:33 -0800 Subject: [PATCH 5/6] =?UTF-8?q?=F0=9F=94=A7=20Replace=20Super=20Linter=20w?= =?UTF-8?q?ith=20enhanced=20pre-commit?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Delete Super Linter workflow (slow, overly pedantic) - Add shellcheck for bash/sh scripts (excludes zsh) - Update ruff to v0.14.10 - Fix install.sh with proper shebang and set -e Pre-commit is faster, runs locally, and checks what matters. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- .github/workflows/linter.yml | 33 --------------------------------- .pre-commit-config.yaml | 10 +++++++++- install.sh | 7 +++++-- 3 files changed, 14 insertions(+), 36 deletions(-) delete mode 100644 .github/workflows/linter.yml diff --git a/.github/workflows/linter.yml b/.github/workflows/linter.yml deleted file mode 100644 index e7a3158..0000000 --- a/.github/workflows/linter.yml +++ /dev/null @@ -1,33 +0,0 @@ ---- -################################# -## Super Linter GitHub Actions ## -################################# - -# Documentation: -# https://docs.github.com/en/actions/learn-github-actions/workflow-syntax-for-github-actions - -name: Lint Code Base - -on: [push, pull_request] - -jobs: - build: - name: Lint Code Base - runs-on: ubuntu-latest - - steps: - # Checkout the code base - - name: Checkout Code - uses: actions/checkout@v3 - with: - # Full git history is needed to get a proper list of changed files - fetch-depth: 0 - - # Run Linter against code base - - name: Lint Code Base - uses: github/super-linter/slim@v4 - env: - VALIDATE_ALL_CODEBASE: false - DEFAULT_BRANCH: master - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - LINTER_RULES_PATH: / diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 43d8099..44bd7fc 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -17,6 +17,14 @@ repos: files: \.gitignore - id: trailing-whitespace + - repo: https://github.com/shellcheck-py/shellcheck-py + rev: v0.10.0.1 + hooks: + - id: shellcheck + args: [--severity=warning] + # Exclude zsh files - shellcheck only supports sh/bash/dash/ksh + exclude: (\.zsh|\.zshrc|\.zshenv|daily_update_mac\.sh|interpreter\.sh)$ + - repo: https://github.com/Lucas-C/pre-commit-hooks rev: v1.5.5 hooks: @@ -29,7 +37,7 @@ repos: # Ruff replaces flake8, pylint, isort and more - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.14.8 + rev: v0.14.10 hooks: # Run the linter with auto-fix - id: ruff diff --git a/install.sh b/install.sh index ef9d78a..f96a2fa 100644 --- a/install.sh +++ b/install.sh @@ -1,6 +1,9 @@ -cd ~ +#!/usr/bin/env bash +set -e + +cd ~ || exit git clone https://github.com/TechNickAI/homedir.git -cd homedir +cd homedir || exit echo echo "Updating the submodules (vim plugins)" From c615ed6980a2e30812916fb5cc6ab665b431b732 Mon Sep 17 00:00:00 2001 From: Nick Sullivan Date: Sat, 27 Dec 2025 14:52:47 -0800 Subject: [PATCH 6/6] =?UTF-8?q?=F0=9F=90=9B=20Fix=20.macos=20compatibility?= =?UTF-8?q?=20with=20modern=20macOS=20versions?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Address Cursor Bugbot feedback: - Support both "System Preferences" (pre-Ventura) and "System Settings" (Ventura+) - Add new Cursor bundle ID (com.getcursor.Cursor) alongside old todesktop ID - Suppress errors with 2>/dev/null for cross-version compatibility Both commands run to ensure compatibility across macOS versions and Cursor installations. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- .macos | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/.macos b/.macos index 5d8162e..112550c 100755 --- a/.macos +++ b/.macos @@ -6,8 +6,10 @@ # # Inspired by https://github.com/mathiasbynens/dotfiles/blob/main/.macos -# Close any open System Preferences panes to prevent them from overriding settings -osascript -e 'tell application "System Preferences" to quit' +# Close any open System Preferences/Settings panes to prevent them from overriding settings +# macOS Ventura (13.0+) renamed "System Preferences" to "System Settings" +osascript -e 'tell application "System Preferences" to quit' 2>/dev/null +osascript -e 'tell application "System Settings" to quit' 2>/dev/null # Ask for the administrator password upfront sudo -v @@ -33,7 +35,9 @@ defaults write com.apple.screencapture location ~/Desktop/ScreenShots defaults write com.microsoft.VSCode ApplePressAndHoldEnabled -bool false # Enable key repeat for Cursor (so j/k work properly in vim mode) -defaults write com.todesktop.230313mzl4w4u92 ApplePressAndHoldEnabled -bool false +# Older versions use todesktop bundle ID, newer versions use com.getcursor.Cursor +defaults write com.todesktop.230313mzl4w4u92 ApplePressAndHoldEnabled -bool false 2>/dev/null +defaults write com.getcursor.Cursor ApplePressAndHoldEnabled -bool false 2>/dev/null ############################################################################### # Kill affected applications #