From b7d39911054b5c0c7a02b6ba7af7896f5d13a9c7 Mon Sep 17 00:00:00 2001 From: "Alan Rafael R. Batista" Date: Sat, 21 Mar 2026 15:22:55 -0300 Subject: [PATCH 01/29] Replace Vagrant with OrbStack and Multipass for testing Add platform-specific test scripts: - tests/test_mac.sh: uses OrbStack to spin up Ubuntu 24.04 VM on macOS - tests/test_linux.sh: uses Multipass to spin up Ubuntu 24.04 VM on Linux Add CLAUDE.md for Claude Code context. --- CLAUDE.md | 40 ++++++++++++++++++++++++++++++++++++++++ tests/test_linux.sh | 43 +++++++++++++++++++++++++++++++++++++++++++ tests/test_mac.sh | 45 +++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 128 insertions(+) create mode 100644 CLAUDE.md create mode 100755 tests/test_linux.sh create mode 100755 tests/test_mac.sh diff --git a/CLAUDE.md b/CLAUDE.md new file mode 100644 index 0000000..3d6e9be --- /dev/null +++ b/CLAUDE.md @@ -0,0 +1,40 @@ +# CLAUDE.md + +This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository. + +## Overview + +This is **Campus Code Dotfiles (cc_dotfiles)** — a shared dotfiles distribution for zsh, vim, tmux, and git, inspired by [skwp/dotfiles](https://github.com/skwp/dotfiles) and [thoughtbot/dotfiles](https://github.com/thoughtbot/dotfiles). It targets macOS and Ubuntu. + +## Installation + +```bash +# Remote install (clones to ~/.cc_dotfiles, then runs rake install) +sh -c "$(curl -fSs https://raw.githubusercontent.com/campuscode/cc_dotfiles/master/install.sh)" + +# Local install +LOCAL_INSTALL=1 ./install.sh +``` + +The `rake install` task symlinks config files into `~/` (prefixed with `.`), installs fonts, vim-plug plugins, zsh-syntax-highlighting, tmux-battery plugin, and changes the default shell to zsh. + +## Architecture + +**Rakefile** is the main installer — it symlinks files, installs prerequisites via `mac.sh` or `ubuntu.sh`, and sets up plugins. All dotfiles are symlinked from this repo into `$HOME` as hidden files (e.g., `aliases` → `~/.aliases`). + +**Customization layer**: Every config file sources a `.local` counterpart if present. Users should put personal overrides in these files rather than modifying the repo directly: +- `~/.aliases.local`, `~/.zshrc.local`, `~/.zshenv.local`, `~/.vimrc.local`, `~/.plugins.vim.local`, `~/.tmux.conf.local`, `~/.gitconfig.local`, `~/.secrets` + +**Key conventions**: +- Vim leader key is `` +- Tmux prefix is `C-a` (not the default `C-b`) +- Zsh uses vi mode with `jj` bound to escape +- Default colorscheme is gruvbox (dark background) +- Vim plugin manager is [vim-plug](https://github.com/junegunn/vim-plug) (`~/.vim/plugins.vim`) +- Vim settings are auto-loaded from individual files in `vim/settings/*.vim` +- Zsh functions are auto-loaded from `zsh/functions/*` +- Zsh theme is `peepcode` (`zsh/themes/peepcode.theme`) + +**Shell aliases** (`aliases`): extensive git shortcuts (e.g., `gs`=status, `gco`=checkout, `gp`=push, `gpsh`=push current branch), docker-compose aliases (`dc`, `dcr`, `dcup`), and Rails/Ruby aliases (`rc`, `rs`, `rdm`). + +**Git config** (`git/gitconfig`): uses patience diff algorithm, vimdiff as merge tool, rerere enabled, push default is `upstream`. Local overrides via `~/.gitconfig.local`. diff --git a/tests/test_linux.sh b/tests/test_linux.sh new file mode 100755 index 0000000..445b1f2 --- /dev/null +++ b/tests/test_linux.sh @@ -0,0 +1,43 @@ +#!/bin/bash +# Test cc_dotfiles installation on Linux/Ubuntu using Multipass +# +# Requires: Multipass (https://multipass.run) +# sudo snap install multipass +# +# Usage: +# ./tests/test_linux.sh # create VM and install dotfiles +# ./tests/test_linux.sh teardown # destroy the VM +# multipass shell cc-dotfiles # access the VM + +set -eu + +VM_NAME="cc-dotfiles" +PROJECT_DIR="$(cd "$(dirname "$0")/.." && pwd)" + +teardown() { + multipass delete "$VM_NAME" --purge + echo "VM '$VM_NAME' destroyed." +} + +if [ "${1:-}" = "teardown" ]; then + teardown + exit 0 +fi + +# Recreate VM from scratch +if multipass list | grep -q "$VM_NAME"; then + teardown +fi + +multipass launch 24.04 --name "$VM_NAME" --mount "$PROJECT_DIR":/home/ubuntu/cc_dotfiles + +# Install curl (only prerequisite not in base image) +multipass exec "$VM_NAME" -- sudo apt-get update +multipass exec "$VM_NAME" -- sudo apt-get install -y curl + +# Install dotfiles using the mounted project directory +multipass exec "$VM_NAME" -- bash -c 'cd ~/cc_dotfiles && LOCAL_INSTALL=1 sh install.sh' + +echo "" +echo "Done! Access the VM with: multipass shell $VM_NAME" +echo "Project mounted at: /home/ubuntu/cc_dotfiles" diff --git a/tests/test_mac.sh b/tests/test_mac.sh new file mode 100755 index 0000000..ed2e24f --- /dev/null +++ b/tests/test_mac.sh @@ -0,0 +1,45 @@ +#!/bin/bash +# Test cc_dotfiles installation on macOS using OrbStack +# +# Requires: OrbStack (https://orbstack.dev) +# +# OrbStack automatically mounts macOS home at the same path inside the VM, +# so edits on the host are immediately visible in the VM. +# +# Usage: +# ./tests/test_mac.sh # create VM and install dotfiles +# ./tests/test_mac.sh teardown # destroy the VM +# orb shell cc-dotfiles # access the VM + +set -eu + +VM_NAME="cc-dotfiles" +PROJECT_DIR="$(cd "$(dirname "$0")/.." && pwd)" + +teardown() { + orb delete "$VM_NAME" -f + echo "VM '$VM_NAME' destroyed." +} + +if [ "${1:-}" = "teardown" ]; then + teardown + exit 0 +fi + +# Recreate VM from scratch +if orb list | grep -q "$VM_NAME"; then + teardown +fi + +orb create ubuntu:24.04 "$VM_NAME" + +# Install curl (only prerequisite not in base image) +orb run -m "$VM_NAME" sudo apt-get update +orb run -m "$VM_NAME" sudo apt-get install -y curl + +# Install dotfiles using the mounted project directory +orb run -m "$VM_NAME" bash -c "cd $PROJECT_DIR && LOCAL_INSTALL=1 sh install.sh" + +echo "" +echo "Done! Access the VM with: orb shell $VM_NAME" +echo "Project mounted at: $PROJECT_DIR" From 06f3f27520d1b1c51b2b2e12c3007a8e98c279d1 Mon Sep 17 00:00:00 2001 From: "Alan Rafael R. Batista" Date: Sat, 21 Mar 2026 15:28:55 -0300 Subject: [PATCH 02/29] Replace RVM with mise for Ruby and Node.js version management MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit mise is faster, simpler to install (no GPG keys), and manages both Ruby and Node.js — removing the need for separate tools (RVM, nodesource, yarn repo). --- Rakefile | 5 +---- install.sh | 28 ++++++++-------------------- ubuntu.sh | 1 - zshrc | 7 ++----- 4 files changed, 11 insertions(+), 30 deletions(-) diff --git a/Rakefile b/Rakefile index 41ad9d5..79570fb 100644 --- a/Rakefile +++ b/Rakefile @@ -109,9 +109,6 @@ end def linux_message puts '' puts "- Change your terminal window to Run command as login shell and RESTART" - puts '' - puts "- You can find more information about this on \r -https://github.com/rvm/ubuntu_rvm" end def installation_message @@ -121,7 +118,7 @@ def installation_message puts 'Thank you!' puts '' puts '' - linux_message if linux? + puts "- Run 'mise install ruby node' to install latest versions" if linux? puts '=======================================================================' end diff --git a/install.sh b/install.sh index d9662df..6367733 100755 --- a/install.sh +++ b/install.sh @@ -7,24 +7,16 @@ then echo " - tmux" echo " - silver searcher" echo " - zsh" - echo " - rvm" - echo " - nodejs" + echo " - mise (Ruby, Node.js)" case "$(uname -s)" in Linux) - echo " - vim (vim-gnome)" + echo " - vim (vim-gtk3)" echo " - Docker" echo " - docker-compose" - NODE_VERSION=12 sudo apt-get update - sudo apt-get install -y software-properties-common gnupg2 dconf-cli uuid-runtime - curl -sSL https://rvm.io/mpapis.asc | gpg2 --import - - curl -sSL https://rvm.io/pkuczynski.asc | gpg2 --import - - curl -sSL https://get.rvm.io | bash -s stable --ruby - curl -sL https://deb.nodesource.com/setup_${NODE_VERSION}.x | sudo -E bash - - curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add - - echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list + sudo apt-get install -y software-properties-common dconf-cli uuid-runtime sudo apt-get install -y silversearcher-ag \ git \ @@ -33,22 +25,18 @@ then zsh \ dconf-cli \ vim-gtk3 \ - nodejs \ - yarn \ ruby \ libevent-dev \ ncurses-dev \ bison \ pkg-config + + curl https://mise.run | sh + ~/.local/bin/mise install ruby node ;; Darwin ) - echo " - vim (macvim)" - echo " - google-chrome (mac)" - echo " - iterm2 (mac)" - echo " - atom (mac)" - gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB - curl -sSL https://get.rvm.io | bash -s stable --ruby - sudo usermod -a -G rvm `whoami` + curl https://mise.run | sh + ~/.local/bin/mise install ruby node ;; CYGWIN* | MSYS*) echo 'You are using a Windows machine which is not recommended to use with our' \ diff --git a/ubuntu.sh b/ubuntu.sh index 624a790..20f93b5 100755 --- a/ubuntu.sh +++ b/ubuntu.sh @@ -37,5 +37,4 @@ install_tmux > /dev/null 2>&1 install_gnome_terminal_colors install_docker -sudo apt-get remove -y ruby sudo apt-get autoremove -y diff --git a/zshrc b/zshrc index 81fd3d0..ef2a910 100644 --- a/zshrc +++ b/zshrc @@ -70,8 +70,5 @@ source ~/.zsh/themes/peepcode.theme setopt interactivecomments -# Load RVM into a shell session *as a function* -[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" - -# Add RVM to PATH for scripting. Make sure this is the last PATH variable change. -export PATH="$PATH:$HOME/.rvm/bin" +# Load mise (Ruby, Node.js version manager) +eval "$(~/.local/bin/mise activate zsh)" From 061248492b72caf8a6c7e735030b3e5c703a20a5 Mon Sep 17 00:00:00 2001 From: "Alan Rafael R. Batista" Date: Sat, 21 Mar 2026 15:36:16 -0300 Subject: [PATCH 03/29] Update Docker installation to use official repository Use docker-ce from Docker's apt repository instead of the outdated docker.io Ubuntu package. Docker Compose v2 is now installed as a plugin (docker-compose-plugin) instead of the standalone v1 binary. --- ubuntu.sh | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/ubuntu.sh b/ubuntu.sh index 20f93b5..0b50771 100755 --- a/ubuntu.sh +++ b/ubuntu.sh @@ -26,11 +26,16 @@ install_gnome_terminal_colors() { } install_docker() { - DOCKER_COMPOSE_VERSION="${DOCKER_COMPOSE_VERSION:-1.29.2}" - sudo apt-get install -y docker.io - sudo curl -L "https://github.com/docker/compose/releases/download/${DOCKER_COMPOSE_VERSION}/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose - sudo chmod +x /usr/local/bin/docker-compose - sudo adduser $(users) docker + sudo install -m 0755 -d /etc/apt/keyrings + sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc + sudo chmod a+r /etc/apt/keyrings/docker.asc + + echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu \ + $(. /etc/os-release && echo "$VERSION_CODENAME") stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null + + sudo apt-get update + sudo apt-get install -y docker-ce docker-ce-cli containerd.io docker-compose-plugin + sudo usermod -aG docker "$(whoami)" } install_tmux > /dev/null 2>&1 From 461670fda464efedfd7ae08569f2b08203030595 Mon Sep 17 00:00:00 2001 From: "Alan Rafael R. Batista" Date: Sat, 21 Mar 2026 15:41:46 -0300 Subject: [PATCH 04/29] Update tmux version from 3.1b to 3.6a --- ubuntu.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ubuntu.sh b/ubuntu.sh index 0b50771..fcedaf5 100755 --- a/ubuntu.sh +++ b/ubuntu.sh @@ -1,7 +1,7 @@ #!/bin/bash install_tmux() { - TMUX_VERSION="3.1b" + TMUX_VERSION="${TMUX_VERSION:-3.6a}" TMUX_SOURCE_FILE="tmux-${TMUX_VERSION}.tar.gz" TMUX_SOURCE_FOLDER="tmux-${TMUX_VERSION}" From 120a845c275f382e030a2d971f204f3deccd6513 Mon Sep 17 00:00:00 2001 From: "Alan Rafael R. Batista" Date: Sat, 21 Mar 2026 15:45:33 -0300 Subject: [PATCH 05/29] Improve ubuntu.sh: update Gogh URL, standardize on curl, make Docker optional - Replace wget with curl for consistency across the project - Update Gogh terminal colors URL from deprecated git.io shortlink to the direct GitHub raw URL - Show tmux build output instead of suppressing it - Make Docker installation skippable with SKIP_DOCKER=1 - Quote variables to handle paths with spaces --- ubuntu.sh | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/ubuntu.sh b/ubuntu.sh index fcedaf5..0b4e4ec 100755 --- a/ubuntu.sh +++ b/ubuntu.sh @@ -6,22 +6,22 @@ install_tmux() { TMUX_SOURCE_FOLDER="tmux-${TMUX_VERSION}" echo "Installing tmux ${TMUX_VERSION}" - wget https://github.com/tmux/tmux/releases/download/${TMUX_VERSION}/${TMUX_SOURCE_FILE} - tar -xf ${TMUX_SOURCE_FILE} - pushd $TMUX_SOURCE_FOLDER + curl -LO "https://github.com/tmux/tmux/releases/download/${TMUX_VERSION}/${TMUX_SOURCE_FILE}" + tar -xf "${TMUX_SOURCE_FILE}" + pushd "$TMUX_SOURCE_FOLDER" ./configure make sudo make install popd - rm -rf $TMUX_SOURCE_FOLDER - rm $TMUX_SOURCE_FILE + rm -rf "$TMUX_SOURCE_FOLDER" + rm "$TMUX_SOURCE_FILE" } install_gnome_terminal_colors() { - if [[ -z "${TERMINAL}" ]]; then - TERMINAL=gnome-terminal bash -c "$(wget -qO- https://git.io/vQgMr)" + if [[ -z "${TERMINAL}" ]]; then + TERMINAL=gnome-terminal bash -c "$(curl -sSLo- https://raw.githubusercontent.com/Mayccoll/Gogh/master/gogh.sh)" else - bash -c "$(wget -qO- https://git.io/vQgMr)" + bash -c "$(curl -sSLo- https://raw.githubusercontent.com/Mayccoll/Gogh/master/gogh.sh)" fi } @@ -38,8 +38,11 @@ install_docker() { sudo usermod -aG docker "$(whoami)" } -install_tmux > /dev/null 2>&1 +install_tmux install_gnome_terminal_colors -install_docker + +if [ "${SKIP_DOCKER:-}" != "1" ]; then + install_docker +fi sudo apt-get autoremove -y From 0df1a79b4825515487c6c84414a69f58d95950b4 Mon Sep 17 00:00:00 2001 From: "Alan Rafael R. Batista" Date: Sat, 21 Mar 2026 16:14:44 -0300 Subject: [PATCH 06/29] Update install.sh: remove system ruby, use mise for rake install Activate mise in the shell before running rake install so Ruby comes from mise instead of apt. Also fix return/exit, add set -eu, remove duplicated dconf-cli, and simplify unsupported OS handling. --- install.sh | 109 +++++++++++++++++++++++++---------------------------- 1 file changed, 52 insertions(+), 57 deletions(-) diff --git a/install.sh b/install.sh index 6367733..e8be9ee 100755 --- a/install.sh +++ b/install.sh @@ -1,64 +1,59 @@ -#!/bin/sh +#!/bin/bash +set -eu -if [ ! -d "$HOME/.cc_dotfiles" ] -then - echo "Installing Campus Code Dotfiles" - echo "We'll install:" - echo " - tmux" - echo " - silver searcher" - echo " - zsh" - echo " - mise (Ruby, Node.js)" +if [ -d "$HOME/.cc_dotfiles" ]; then + echo "You already have Campus Code Dotfiles installed." + exit 0 +fi + +echo "Installing Campus Code Dotfiles" +echo "We'll install:" +echo " - tmux" +echo " - silver searcher" +echo " - zsh" +echo " - mise (Ruby, Node.js)" + +case "$(uname -s)" in + Linux) + echo " - vim (vim-gtk3)" - case "$(uname -s)" in - Linux) - echo " - vim (vim-gtk3)" - echo " - Docker" - echo " - docker-compose" + sudo apt-get update + sudo apt-get install -y software-properties-common dconf-cli uuid-runtime - sudo apt-get update - sudo apt-get install -y software-properties-common dconf-cli uuid-runtime + sudo apt-get install -y silversearcher-ag \ + git \ + xclip \ + build-essential \ + zsh \ + vim-gtk3 \ + libevent-dev \ + ncurses-dev \ + bison \ + pkg-config - sudo apt-get install -y silversearcher-ag \ - git \ - xclip \ - build-essential \ - zsh \ - dconf-cli \ - vim-gtk3 \ - ruby \ - libevent-dev \ - ncurses-dev \ - bison \ - pkg-config + curl https://mise.run | sh + eval "$(~/.local/bin/mise activate bash)" + mise install ruby node + ;; + Darwin) + curl https://mise.run | sh + eval "$(~/.local/bin/mise activate bash)" + mise install ruby node + ;; + *) + echo "Operational system not supported, aborting installation" + exit 1 + ;; +esac - curl https://mise.run | sh - ~/.local/bin/mise install ruby node - ;; - Darwin ) - curl https://mise.run | sh - ~/.local/bin/mise install ruby node - ;; - CYGWIN* | MSYS*) - echo 'You are using a Windows machine which is not recommended to use with our' \ - ' dotfiles.' - echo 'You can clone our repository and try install it manually.' - return - ;; - *) - echo 'Operational system not recognized, aborting installation' - return - ;; - esac - if [ -z "$LOCAL_INSTALL" ] - then - echo "FROM REMOTE SOURCE" - git clone --depth=10 https://github.com/campuscode/cc_dotfiles.git "$HOME/.cc_dotfiles" - else - echo "LOCAL SOURCE" - cp -r . "$HOME/.cc_dotfiles" - fi - cd "$HOME/.cc_dotfiles" - rake install +if [ -z "${LOCAL_INSTALL:-}" ]; then + echo "Installing from remote source" + git clone --depth=10 https://github.com/campuscode/cc_dotfiles.git "$HOME/.cc_dotfiles" else - echo "You already have Campus Code Dotfiles installed." + echo "Installing from local source" + cp -r . "$HOME/.cc_dotfiles" fi + +cd "$HOME/.cc_dotfiles" +rake install + From 3d5881e88848d5ff0b720d28e737525800fe0f0b Mon Sep 17 00:00:00 2001 From: "Alan Rafael R. Batista" Date: Sat, 21 Mar 2026 16:19:56 -0300 Subject: [PATCH 07/29] Update mac.sh: fix Homebrew installer, replace deprecated packages - Update Homebrew install command to current method - Replace hub with gh (GitHub CLI) - Remove reattach-to-user-namespace (unnecessary since tmux 2.6+) - Remove macvim obsolete flags - Replace Atom (discontinued) with VS Code - Use brew install --cask (replaces deprecated brew cask install) --- mac.sh | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/mac.sh b/mac.sh index 2f36aff..328e0f9 100755 --- a/mac.sh +++ b/mac.sh @@ -1,9 +1,6 @@ -#!/bin/sh - -ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" -brew install zsh ctags git hub tmux reattach-to-user-namespace the_silver_searcher -brew install macvim --custom-icons --override-system-vim --with-lua --with-luajit -brew cask install atom -brew cask install google-chrome -brew cask install iterm2 +#!/bin/bash +set -eu +/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" +brew install zsh ctags git gh tmux the_silver_searcher macvim +brew install --cask visual-studio-code google-chrome iterm2 From 13808f694db9b55352c47a4bf40a2892ffc5198d Mon Sep 17 00:00:00 2001 From: "Alan Rafael R. Batista" Date: Sat, 21 Mar 2026 16:26:05 -0300 Subject: [PATCH 08/29] Switch test_mac.sh from OrbStack to UTM for graphical testing UTM provides a full Ubuntu Desktop VM with graphical interface, allowing visual verification of terminal colors, fonts, and themes. Add tests/README.md with setup and usage instructions for both macOS (UTM) and Linux (Multipass) testing. --- tests/README.md | 54 +++++++++++++++++++++++++++++++++++++++++++++++ tests/test_mac.sh | 43 +++++++++++++++++-------------------- 2 files changed, 73 insertions(+), 24 deletions(-) create mode 100644 tests/README.md diff --git a/tests/README.md b/tests/README.md new file mode 100644 index 0000000..eb2e1d0 --- /dev/null +++ b/tests/README.md @@ -0,0 +1,54 @@ +# Testing cc_dotfiles + +Test the dotfiles installation in an isolated VM before deploying to your machine. + +## macOS (UTM) + +Uses [UTM](https://mac.getutm.app) to run an Ubuntu Desktop VM with a graphical interface, +so you can visually verify the full installation (terminal colors, fonts, vim, tmux, etc). + +### Setup (one-time) + +1. Install UTM: `brew install --cask utm` +2. Download the [Ubuntu Desktop 24.04 ISO](https://ubuntu.com/download/desktop) +3. Create a new VM in UTM named `cc-dotfiles` using the ISO +4. In VM settings, enable directory sharing and point it to this repository + +### Usage + +```bash +./tests/test_mac.sh # start the VM +./tests/test_mac.sh teardown # stop the VM +``` + +Once the VM is running, open UTM and inside the VM terminal run: + +```bash +cd /path/to/shared/cc_dotfiles && LOCAL_INSTALL=1 sh install.sh +``` + +## Linux/Ubuntu (Multipass) + +Uses [Multipass](https://multipass.run) to run a headless Ubuntu VM with the project +directory mounted. Good for quick terminal-only testing. + +### Setup (one-time) + +```bash +sudo snap install multipass +``` + +### Usage + +```bash +./tests/test_linux.sh # create VM and install dotfiles +./tests/test_linux.sh teardown # destroy the VM +multipass shell cc-dotfiles # access the VM +``` + +The project is mounted at `/home/ubuntu/cc_dotfiles` inside the VM. +Edits on the host are immediately visible in the VM. + +## Options + +- `SKIP_DOCKER=1` — skip Docker installation (set in the VM before running install.sh) diff --git a/tests/test_mac.sh b/tests/test_mac.sh index ed2e24f..f38b806 100755 --- a/tests/test_mac.sh +++ b/tests/test_mac.sh @@ -1,24 +1,23 @@ #!/bin/bash -# Test cc_dotfiles installation on macOS using OrbStack +# Test cc_dotfiles installation on macOS using UTM # -# Requires: OrbStack (https://orbstack.dev) +# Requires: UTM (https://mac.getutm.app) with utmctl CLI +# brew install --cask utm # -# OrbStack automatically mounts macOS home at the same path inside the VM, -# so edits on the host are immediately visible in the VM. +# Before first run, create an Ubuntu Desktop 24.04 VM in UTM named "cc-dotfiles". +# Enable directory sharing in VM settings pointing to this project's parent directory. # # Usage: -# ./tests/test_mac.sh # create VM and install dotfiles -# ./tests/test_mac.sh teardown # destroy the VM -# orb shell cc-dotfiles # access the VM +# ./tests/test_mac.sh # start VM and install dotfiles +# ./tests/test_mac.sh teardown # stop the VM set -eu VM_NAME="cc-dotfiles" -PROJECT_DIR="$(cd "$(dirname "$0")/.." && pwd)" teardown() { - orb delete "$VM_NAME" -f - echo "VM '$VM_NAME' destroyed." + utmctl stop "$VM_NAME" + echo "VM '$VM_NAME' stopped." } if [ "${1:-}" = "teardown" ]; then @@ -26,20 +25,16 @@ if [ "${1:-}" = "teardown" ]; then exit 0 fi -# Recreate VM from scratch -if orb list | grep -q "$VM_NAME"; then - teardown +# Start the VM if not already running +if ! utmctl status "$VM_NAME" | grep -q "started"; then + utmctl start "$VM_NAME" + echo "Waiting for VM to boot..." + sleep 30 fi -orb create ubuntu:24.04 "$VM_NAME" - -# Install curl (only prerequisite not in base image) -orb run -m "$VM_NAME" sudo apt-get update -orb run -m "$VM_NAME" sudo apt-get install -y curl - -# Install dotfiles using the mounted project directory -orb run -m "$VM_NAME" bash -c "cd $PROJECT_DIR && LOCAL_INSTALL=1 sh install.sh" - echo "" -echo "Done! Access the VM with: orb shell $VM_NAME" -echo "Project mounted at: $PROJECT_DIR" +echo "VM '$VM_NAME' is running." +echo "Open UTM to access the graphical desktop." +echo "" +echo "Inside the VM, run:" +echo " cd /path/to/shared/cc_dotfiles && LOCAL_INSTALL=1 sh install.sh" From 0fb6767122f1bc222999739fb927262a65960dc0 Mon Sep 17 00:00:00 2001 From: "Alan Rafael R. Batista" Date: Sat, 21 Mar 2026 16:28:49 -0300 Subject: [PATCH 09/29] Expand macOS testing instructions with detailed UTM setup guide Add step-by-step instructions for creating the VM, installing Ubuntu, configuring directory sharing, mounting shared folders, and verifying the dotfiles installation. --- tests/README.md | 65 ++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 61 insertions(+), 4 deletions(-) diff --git a/tests/README.md b/tests/README.md index eb2e1d0..6934677 100644 --- a/tests/README.md +++ b/tests/README.md @@ -9,10 +9,52 @@ so you can visually verify the full installation (terminal colors, fonts, vim, t ### Setup (one-time) -1. Install UTM: `brew install --cask utm` +1. Install UTM: + +```bash +brew install --cask utm +``` + 2. Download the [Ubuntu Desktop 24.04 ISO](https://ubuntu.com/download/desktop) -3. Create a new VM in UTM named `cc-dotfiles` using the ISO -4. In VM settings, enable directory sharing and point it to this repository + +3. Create the VM in UTM: + - Open UTM and click **Create a New Virtual Machine** + - Select **Virtualize** (Apple Silicon) or **Emulate** (Intel) + - Choose **Linux** + - In **Boot ISO Image**, browse and select the Ubuntu 24.04 ISO + - Recommended settings: 4GB RAM, 2+ CPU cores, 25GB disk + - Finish the wizard and name the VM `cc-dotfiles` + +4. Install Ubuntu inside the VM: + - Start the VM and follow the Ubuntu Desktop installer + - Choose a simple username/password (e.g., `dev`/`dev`) + - Reboot when prompted (remove the ISO from the CD/DVD drive in UTM settings if it boots back into the installer) + +5. Configure directory sharing: + - Stop the VM + - In UTM, select the VM and click **Edit** (gear icon) + - Go to **Sharing** + - Enable **Directory sharing** and set the path to this repository's directory + - Start the VM again + +6. Mount the shared folder inside the VM: + +```bash +# Inside the VM, install spice tools for shared folders +sudo apt-get update +sudo apt-get install -y spice-vdagent spice-webdavd davfs2 curl + +# Create mount point and mount +sudo mkdir -p /mnt/cc_dotfiles +sudo mount -t davfs http://localhost:9843 /mnt/cc_dotfiles +# When prompted for username/password, just press Enter for both +``` + +To auto-mount on boot, add to `/etc/fstab`: + +``` +http://localhost:9843 /mnt/cc_dotfiles davfs user,noauto 0 0 +``` ### Usage @@ -24,9 +66,24 @@ so you can visually verify the full installation (terminal colors, fonts, vim, t Once the VM is running, open UTM and inside the VM terminal run: ```bash -cd /path/to/shared/cc_dotfiles && LOCAL_INSTALL=1 sh install.sh +cd /mnt/cc_dotfiles && LOCAL_INSTALL=1 sh install.sh ``` +### Testing after installation + +Inside the VM, verify: +- Open a new terminal — it should be running zsh with the peepcode theme +- Run `vim` — should open with gruvbox colorscheme and all plugins loaded +- Run `tmux` — prefix should be `C-a`, status bar should be styled +- Run `mise current` — should show Ruby and Node.js versions +- Run `git config --list` — should include the cc_dotfiles git aliases + +### Starting over + +To test a clean install from scratch, you can either: +- Delete `~/.cc_dotfiles` inside the VM and re-run `install.sh` +- Or destroy the VM in UTM and recreate it from a snapshot + ## Linux/Ubuntu (Multipass) Uses [Multipass](https://multipass.run) to run a headless Ubuntu VM with the project From dce2d5512f06b2299e84fc4eed8b74913710b91d Mon Sep 17 00:00:00 2001 From: "Alan Rafael R. Batista" Date: Sat, 21 Mar 2026 16:31:44 -0300 Subject: [PATCH 10/29] Remove test_mac.sh, UTM setup is manual and documented in README Unlike Multipass, UTM requires manual VM creation and configuration. The script only wrapped trivial start/stop commands. Full instructions are in tests/README.md. --- tests/test_mac.sh | 40 ---------------------------------------- 1 file changed, 40 deletions(-) delete mode 100755 tests/test_mac.sh diff --git a/tests/test_mac.sh b/tests/test_mac.sh deleted file mode 100755 index f38b806..0000000 --- a/tests/test_mac.sh +++ /dev/null @@ -1,40 +0,0 @@ -#!/bin/bash -# Test cc_dotfiles installation on macOS using UTM -# -# Requires: UTM (https://mac.getutm.app) with utmctl CLI -# brew install --cask utm -# -# Before first run, create an Ubuntu Desktop 24.04 VM in UTM named "cc-dotfiles". -# Enable directory sharing in VM settings pointing to this project's parent directory. -# -# Usage: -# ./tests/test_mac.sh # start VM and install dotfiles -# ./tests/test_mac.sh teardown # stop the VM - -set -eu - -VM_NAME="cc-dotfiles" - -teardown() { - utmctl stop "$VM_NAME" - echo "VM '$VM_NAME' stopped." -} - -if [ "${1:-}" = "teardown" ]; then - teardown - exit 0 -fi - -# Start the VM if not already running -if ! utmctl status "$VM_NAME" | grep -q "started"; then - utmctl start "$VM_NAME" - echo "Waiting for VM to boot..." - sleep 30 -fi - -echo "" -echo "VM '$VM_NAME' is running." -echo "Open UTM to access the graphical desktop." -echo "" -echo "Inside the VM, run:" -echo " cd /path/to/shared/cc_dotfiles && LOCAL_INSTALL=1 sh install.sh" From 8479b5b0f92b1f74a283894ac330b25e58e1a05a Mon Sep 17 00:00:00 2001 From: "Alan Rafael R. Batista" Date: Sat, 21 Mar 2026 16:33:07 -0300 Subject: [PATCH 11/29] Rewrite tests/README.md with detailed UTM setup and remove test_mac.sh references --- tests/README.md | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/tests/README.md b/tests/README.md index 6934677..d190af6 100644 --- a/tests/README.md +++ b/tests/README.md @@ -40,7 +40,7 @@ brew install --cask utm 6. Mount the shared folder inside the VM: ```bash -# Inside the VM, install spice tools for shared folders +# Install spice tools for shared folders sudo apt-get update sudo apt-get install -y spice-vdagent spice-webdavd davfs2 curl @@ -56,20 +56,15 @@ To auto-mount on boot, add to `/etc/fstab`: http://localhost:9843 /mnt/cc_dotfiles davfs user,noauto 0 0 ``` -### Usage - -```bash -./tests/test_mac.sh # start the VM -./tests/test_mac.sh teardown # stop the VM -``` +### Installing dotfiles -Once the VM is running, open UTM and inside the VM terminal run: +Inside the VM terminal: ```bash cd /mnt/cc_dotfiles && LOCAL_INSTALL=1 sh install.sh ``` -### Testing after installation +### Verifying the installation Inside the VM, verify: - Open a new terminal — it should be running zsh with the peepcode theme From 600dd1eff18e5e53c85c3e5761f0190edc465c41 Mon Sep 17 00:00:00 2001 From: "Alan Rafael R. Batista" Date: Sat, 21 Mar 2026 16:45:22 -0300 Subject: [PATCH 12/29] Update Vagrantfile to use UTM provider with Ubuntu 24.04 Replace VirtualBox provider with vagrant_utm plugin, enabling Vagrant automation with UTM's graphical VM on macOS. Update tests/README.md with Vagrant+UTM setup instructions. --- Vagrantfile | 22 ++++++++++++---- tests/README.md | 68 +++++++++++++++---------------------------------- 2 files changed, 38 insertions(+), 52 deletions(-) diff --git a/Vagrantfile b/Vagrantfile index d888fc5..8fa1da7 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -1,11 +1,23 @@ # -*- mode: ruby -*- # vi: set ft=ruby : -Vagrant.configure(2) do |config| - config.vm.box = "ubuntu/focal64" +Vagrant.configure("2") do |config| + config.vm.box = "utm/ubuntu-24.04" - config.vm.synced_folder ".", "/vagrant", id: "vagrant-root" - config.vm.synced_folder "~/workspace", "/workspace", id: "vagrant-repos" + config.vm.provider :utm do |utm| + utm.name = "cc-dotfiles" + utm.memory = 4096 + utm.cpus = 2 + utm.directory_share_mode = "virtFS" + utm.notes = "Campus Code Dotfiles testing VM" + end - config.vm.network :private_network, ip: "192.168.10.10" + config.vm.synced_folder ".", "/vagrant" + + config.vm.provision "shell", inline: "apt-get update && apt-get install -y curl" + + config.vm.provision "shell", privileged: false, inline: <<-SHELL + cd /vagrant + LOCAL_INSTALL=1 sh install.sh + SHELL end diff --git a/tests/README.md b/tests/README.md index d190af6..7a91058 100644 --- a/tests/README.md +++ b/tests/README.md @@ -2,67 +2,41 @@ Test the dotfiles installation in an isolated VM before deploying to your machine. -## macOS (UTM) +## macOS (Vagrant + UTM) -Uses [UTM](https://mac.getutm.app) to run an Ubuntu Desktop VM with a graphical interface, -so you can visually verify the full installation (terminal colors, fonts, vim, tmux, etc). +Uses [Vagrant](https://www.vagrantup.com) with the [vagrant_utm](https://github.com/naveenrajm7/vagrant_utm) plugin +to run an Ubuntu Desktop VM via UTM. Provides a graphical interface for visually verifying +terminal colors, fonts, vim, tmux, etc. ### Setup (one-time) -1. Install UTM: +1. Install UTM and Vagrant: ```bash brew install --cask utm +brew install --cask vagrant ``` -2. Download the [Ubuntu Desktop 24.04 ISO](https://ubuntu.com/download/desktop) - -3. Create the VM in UTM: - - Open UTM and click **Create a New Virtual Machine** - - Select **Virtualize** (Apple Silicon) or **Emulate** (Intel) - - Choose **Linux** - - In **Boot ISO Image**, browse and select the Ubuntu 24.04 ISO - - Recommended settings: 4GB RAM, 2+ CPU cores, 25GB disk - - Finish the wizard and name the VM `cc-dotfiles` - -4. Install Ubuntu inside the VM: - - Start the VM and follow the Ubuntu Desktop installer - - Choose a simple username/password (e.g., `dev`/`dev`) - - Reboot when prompted (remove the ISO from the CD/DVD drive in UTM settings if it boots back into the installer) - -5. Configure directory sharing: - - Stop the VM - - In UTM, select the VM and click **Edit** (gear icon) - - Go to **Sharing** - - Enable **Directory sharing** and set the path to this repository's directory - - Start the VM again - -6. Mount the shared folder inside the VM: +2. Install the UTM provider plugin: ```bash -# Install spice tools for shared folders -sudo apt-get update -sudo apt-get install -y spice-vdagent spice-webdavd davfs2 curl - -# Create mount point and mount -sudo mkdir -p /mnt/cc_dotfiles -sudo mount -t davfs http://localhost:9843 /mnt/cc_dotfiles -# When prompted for username/password, just press Enter for both +vagrant plugin install vagrant_utm ``` -To auto-mount on boot, add to `/etc/fstab`: +### Usage -``` -http://localhost:9843 /mnt/cc_dotfiles davfs user,noauto 0 0 +```bash +vagrant up # create VM, install dotfiles +vagrant ssh # access the VM via terminal +vagrant halt # stop the VM +vagrant destroy -f # destroy the VM +vagrant up --provision # recreate and re-provision from scratch ``` -### Installing dotfiles +To open the graphical desktop, use the UTM app — the VM will appear as `cc-dotfiles`. -Inside the VM terminal: - -```bash -cd /mnt/cc_dotfiles && LOCAL_INSTALL=1 sh install.sh -``` +The project directory is synced to `/vagrant` inside the VM. +Edits on the host are immediately visible in the VM. ### Verifying the installation @@ -75,9 +49,9 @@ Inside the VM, verify: ### Starting over -To test a clean install from scratch, you can either: -- Delete `~/.cc_dotfiles` inside the VM and re-run `install.sh` -- Or destroy the VM in UTM and recreate it from a snapshot +```bash +vagrant destroy -f && vagrant up +``` ## Linux/Ubuntu (Multipass) From 72a1fa68f2f040c806d1fb3ab712e6c02bc837a9 Mon Sep 17 00:00:00 2001 From: "Alan Rafael R. Batista" Date: Sat, 21 Mar 2026 19:18:55 -0300 Subject: [PATCH 13/29] Fix install.sh for VM testing and update peepcode theme for mise - Add Ruby build dependencies (libssl-dev, libreadline-dev, etc) - Use mise precompiled binaries (ruby.compile=false) - Use mise use --global instead of mise install for proper activation - Replace cp with rsync to handle VirtFS permission issues - Download vim-plug from GitHub instead of copying from mount - Update peepcode theme RPROMPT: replace rvm-prompt with mise showing ruby-X.Y.Z and node-X.Y.Z - Fix sh -> bash in test scripts and README - Add --provider=utm to README commands --- Vagrantfile | 8 ++++---- install.sh | 17 +++++++++++++---- tests/README.md | 15 +++++++++------ tests/test_linux.sh | 2 +- zsh/themes/peepcode.theme | 2 +- 5 files changed, 28 insertions(+), 16 deletions(-) diff --git a/Vagrantfile b/Vagrantfile index 8fa1da7..36fb9e5 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -16,8 +16,8 @@ Vagrant.configure("2") do |config| config.vm.provision "shell", inline: "apt-get update && apt-get install -y curl" - config.vm.provision "shell", privileged: false, inline: <<-SHELL - cd /vagrant - LOCAL_INSTALL=1 sh install.sh - SHELL + # config.vm.provision "shell", privileged: false, inline: <<-SHELL + # cd /vagrant + # LOCAL_INSTALL=1 sh install.sh + # SHELL end diff --git a/install.sh b/install.sh index e8be9ee..4c3c947 100755 --- a/install.sh +++ b/install.sh @@ -29,16 +29,23 @@ case "$(uname -s)" in libevent-dev \ ncurses-dev \ bison \ - pkg-config + pkg-config \ + libssl-dev \ + libreadline-dev \ + zlib1g-dev \ + libyaml-dev \ + libffi-dev curl https://mise.run | sh eval "$(~/.local/bin/mise activate bash)" - mise install ruby node + mise settings ruby.compile=false + mise use --global ruby node ;; Darwin) curl https://mise.run | sh eval "$(~/.local/bin/mise activate bash)" - mise install ruby node + mise settings ruby.compile=false + mise use --global ruby node ;; *) echo "Operational system not supported, aborting installation" @@ -51,7 +58,9 @@ if [ -z "${LOCAL_INSTALL:-}" ]; then git clone --depth=10 https://github.com/campuscode/cc_dotfiles.git "$HOME/.cc_dotfiles" else echo "Installing from local source" - cp -r . "$HOME/.cc_dotfiles" + rsync -a --no-perms --exclude='.vagrant' --exclude='.git' --exclude='tags' --exclude='vim/autoload' --exclude='vim/bundle' --exclude='vim/backups' . "$HOME/.cc_dotfiles" + curl -fLo "$HOME/.cc_dotfiles/vim/autoload/plug.vim" --create-dirs \ + https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim fi cd "$HOME/.cc_dotfiles" diff --git a/tests/README.md b/tests/README.md index 7a91058..861fd98 100644 --- a/tests/README.md +++ b/tests/README.md @@ -26,13 +26,16 @@ vagrant plugin install vagrant_utm ### Usage ```bash -vagrant up # create VM, install dotfiles -vagrant ssh # access the VM via terminal -vagrant halt # stop the VM -vagrant destroy -f # destroy the VM -vagrant up --provision # recreate and re-provision from scratch +vagrant up --provider=utm # create VM, install dotfiles +vagrant ssh # access the VM via terminal +vagrant halt # stop the VM +vagrant destroy -f # destroy the VM +vagrant up --provision # re-provision existing VM ``` +After the first `vagrant up --provider=utm`, subsequent commands (`vagrant ssh`, `vagrant halt`, etc) +don't need the `--provider` flag. + To open the graphical desktop, use the UTM app — the VM will appear as `cc-dotfiles`. The project directory is synced to `/vagrant` inside the VM. @@ -50,7 +53,7 @@ Inside the VM, verify: ### Starting over ```bash -vagrant destroy -f && vagrant up +vagrant destroy -f && vagrant up --provider=utm ``` ## Linux/Ubuntu (Multipass) diff --git a/tests/test_linux.sh b/tests/test_linux.sh index 445b1f2..a88c93e 100755 --- a/tests/test_linux.sh +++ b/tests/test_linux.sh @@ -36,7 +36,7 @@ multipass exec "$VM_NAME" -- sudo apt-get update multipass exec "$VM_NAME" -- sudo apt-get install -y curl # Install dotfiles using the mounted project directory -multipass exec "$VM_NAME" -- bash -c 'cd ~/cc_dotfiles && LOCAL_INSTALL=1 sh install.sh' +multipass exec "$VM_NAME" -- bash -c 'cd ~/cc_dotfiles && LOCAL_INSTALL=1 bash install.sh' echo "" echo "Done! Access the VM with: multipass shell $VM_NAME" diff --git a/zsh/themes/peepcode.theme b/zsh/themes/peepcode.theme index 94ae421..6797433 100644 --- a/zsh/themes/peepcode.theme +++ b/zsh/themes/peepcode.theme @@ -52,6 +52,6 @@ PROMPT=' %~ ${smiley} %{$reset_color%}' -RPROMPT='%{$fg[white]%} $(~/.rvm/bin/rvm-prompt)$(git_prompt)%{$reset_color%}' +RPROMPT='%{$fg[white]%} ruby-$(mise current ruby 2>/dev/null) node-$(mise current node 2>/dev/null)$(git_prompt)%{$reset_color%}' # vi: set ft=zsh : From 27165780f931ed33ae78ce75c2c583302f72bc13 Mon Sep 17 00:00:00 2001 From: "Alan Rafael R. Batista" Date: Sat, 21 Mar 2026 20:19:13 -0300 Subject: [PATCH 14/29] Switch to bento/ubuntu-24.04 box and add rsync to install.sh Use bento box which is more stable and well-maintained. Keep provisioning minimal (only curl) so the user can run install.sh interactively (chsh password, Gogh theme selection). Add rsync as a dependency in install.sh for local installs. --- Vagrantfile | 7 +------ install.sh | 3 ++- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/Vagrantfile b/Vagrantfile index 36fb9e5..0574a29 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -2,7 +2,7 @@ # vi: set ft=ruby : Vagrant.configure("2") do |config| - config.vm.box = "utm/ubuntu-24.04" + config.vm.box = "bento/ubuntu-24.04" config.vm.provider :utm do |utm| utm.name = "cc-dotfiles" @@ -15,9 +15,4 @@ Vagrant.configure("2") do |config| config.vm.synced_folder ".", "/vagrant" config.vm.provision "shell", inline: "apt-get update && apt-get install -y curl" - - # config.vm.provision "shell", privileged: false, inline: <<-SHELL - # cd /vagrant - # LOCAL_INSTALL=1 sh install.sh - # SHELL end diff --git a/install.sh b/install.sh index 4c3c947..5ff15b1 100755 --- a/install.sh +++ b/install.sh @@ -20,7 +20,8 @@ case "$(uname -s)" in sudo apt-get update sudo apt-get install -y software-properties-common dconf-cli uuid-runtime - sudo apt-get install -y silversearcher-ag \ + sudo apt-get install -y rsync \ + silversearcher-ag \ git \ xclip \ build-essential \ From 29559b5130cca63b260203cf3d888a1a740dfde3 Mon Sep 17 00:00:00 2001 From: "Alan Rafael R. Batista" Date: Sat, 21 Mar 2026 20:40:42 -0300 Subject: [PATCH 15/29] Update aliases: docker compose v2, fix deprecated flags and commands MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - docker-compose → docker compose (Compose v2 plugin) - gem install --no-ri --no-rdoc → --no-document (RubyGems 3.0+) - rake db:migrate/rollback/redo → rails (Rails 5+) - rake routes → rails routes - rspec spec → rspec (argument redundant) - gpom now pushes current branch instead of hardcoded master - brew prune removed (included in brew cleanup) - Fix gi alias conflict: rename gitignore edit to gie - Use command -v instead of mvim --version for shell startup speed --- aliases | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/aliases b/aliases index 6344fc8..67d85f8 100644 --- a/aliases +++ b/aliases @@ -41,9 +41,7 @@ alias arl="source $HOME/.aliases.local" alias aliass='alias | grep' # vim using -mvim --version > /dev/null 2>&1 -MACVIM_INSTALLED=$? -if [ $MACVIM_INSTALLED -eq 0 ]; then +if command -v mvim > /dev/null 2>&1; then alias vim="mvim -v" fi @@ -72,7 +70,7 @@ alias gsl='git stash list' alias gsh='git show' alias gshw='git show' alias gshow='git show' -alias gi='vim .gitignore' +alias gie='vim .gitignore' alias gc='git c' alias gcm='git cm' alias gca='git ca' @@ -110,7 +108,7 @@ alias gp='git push' alias gpX='git push --delete' #push current branch alias gpsh='git push -u origin `git rev-parse --abbrev-ref HEAD`' -alias gpom="git push origin master" +alias gpom='git push origin $(git symbolic-ref --short HEAD)' alias gnb='git nb' # new branch aka checkout -b alias grs='git reset' alias grsh='git reset --hard' @@ -123,8 +121,8 @@ alias gbg='git bisect good' alias gbb='git bisect bad' alias gcl="git clone" -# docker-compose -alias dc="docker-compose" +# docker compose +alias dc="docker compose" alias dcr="dc run --rm --service-ports" alias dcR="dc run --rm" # no service ports alias dcrwb="dcr web bash" @@ -154,15 +152,15 @@ alias ka9='killall -9' alias k9='kill -9' # Gem install -alias gi='gem install --no-ri --no-rdoc' +alias gi='gem install --no-document' -alias rdm='rake db:migrate' -alias rdr='rake db:rollback' -alias rdmr='rake db:migrate:redo' -alias rrs='rake routes' +alias rdm='rails db:migrate' +alias rdr='rails db:rollback' +alias rdmr='rails db:migrate:redo' +alias rrs='rails routes' # Rspec -alias rs='rspec spec' +alias rs='rspec' # Rails alias rc='rails c' @@ -174,7 +172,7 @@ then alias showFiles='defaults write com.apple.finder AppleShowAllFiles YES; killall Finder /System/Library/CoreServices/Finder.app' alias hideFiles='defaults write com.apple.finder AppleShowAllFiles NO; killall Finder /System/Library/CoreServices/Finder.app' # Homebrew - alias brewu='brew update && brew upgrade && brew cleanup && brew prune && brew doctor' + alias brewu='brew update && brew upgrade && brew cleanup && brew doctor' alias mykey="cat $HOME/.ssh/id_rsa.pub | pbcopy" fi From 49258d115f377f22b17f9dc6f4ec7b629bc4c863 Mon Sep 17 00:00:00 2001 From: "Alan Rafael R. Batista" Date: Sat, 21 Mar 2026 20:47:13 -0300 Subject: [PATCH 16/29] Update zsh config: increase history, fix guards, remove stale completions - Increase HISTSIZE/SAVEHIST from 4096 to 50000 - Add guards for zsh-syntax-highlighting and mise (don't error if missing) - Only set TERM=screen-256color on Linux - Add ~/.local/bin to PATH (mise install location) - Fix peepcode RPROMPT to not show empty prefixes without mise - Remove outdated completions: docker-compose, rvm, boot2docker, bower, docker-machine --- zsh/completion/_boot2docker | 87 ---------- zsh/completion/_bower | 147 ----------------- zsh/completion/_docker-compose | 197 ---------------------- zsh/completion/_docker-machine | 294 --------------------------------- zsh/completion/_rvm | 127 -------------- zsh/themes/peepcode.theme | 5 +- zshenv | 2 +- zshrc | 12 +- 8 files changed, 12 insertions(+), 859 deletions(-) delete mode 100644 zsh/completion/_boot2docker delete mode 100644 zsh/completion/_bower delete mode 100644 zsh/completion/_docker-compose delete mode 100644 zsh/completion/_docker-machine delete mode 100644 zsh/completion/_rvm diff --git a/zsh/completion/_boot2docker b/zsh/completion/_boot2docker deleted file mode 100644 index 8f1a9c5..0000000 --- a/zsh/completion/_boot2docker +++ /dev/null @@ -1,87 +0,0 @@ -#compdef boot2docker -# ------------------------------------------------------------------------------ -# Description -# ----------- -# -# Completion script for boot2docker (https://github.com/boot2docker/boot2docker-cli). -# -# ------------------------------------------------------------------------------ -# Authors -# ------- -# -# * hhatto (https://github.com/hhatto) -# -# ------------------------------------------------------------------------------ - - -_boot2docker() { - local context state line - - _arguments -C \ - --basevmdk'[Path to VMDK to use as base for persistent partition]:vmdk:' \ - --dhcp'[enable VirtualBox host-only network DHCP. default=true]' \ - --dhcpip'[VirtualBox host-only network DHCP server address. default=192.168.59.99]' \ - '(-s --disksize)'{-s,--disksize}'[boot2docker disk image size (in MB). default=20000.]:disksize:' \ - --dockerport'[host Docker port (forward to port 2375 in VM).]:PORT:' \ - --hostip'[VirtualBox host-only network IP address.]:IP:' \ - --iso'[path to boot2docker ISO image.]:FILE:_files' \ - --lowerip'[VirtualBox host-only network DHCP lower bound.]:IP:' \ - '(-m --memory)'{-m,--memory}'[virtual machine memory size (in MB). default=2048]' \ - --netmask'[VirtualBox host-only network mask.]' \ - --serial'[try serial console to get IP address (experimental) default=false]' \ - --serialfile'[path to the serial socket/pipe.]:FILE:_files' \ - --ssh'[path to SSH client utility. default="ssh"]:SSH:' \ - --ssh-keygen'[path to ssh-keygen utility. default="ssh-keygen"]:KEYGEN:' \ - --sshkey'[path to SSH key to use.]:FILE:_files' \ - --sshport'[host SSH port (forward to port 22 in VM). default=2022]:PORT:' \ - --upperip'[VirtualBox host-only network DHCP upper bound. default=192.168.59.254]:IP:' \ - --vbm'[path to VirtualBox management utility. default="VBoxManage"]' \ - '(-v --verbose)'{-v,--verbose}'[display verbose command invocations. default=false]' \ - --vm'[virtual machine name. default="boot2docker-vm"]' \ - '*::boot2docker commands:_boot2docker_command' -} - -(( $+functions[_boot2docker_command] )) || -_boot2docker_command() { - local _boot2docker_cmds - - _boot2docker_cmds=( - 'init:Create a new boot2docker VM.' \ - 'up:Start VM from any states.' \ - 'start:Start VM from any states.' \ - 'boot:Start VM from any states.' \ - 'ssh:Login to VM via SSH.' \ - 'save:Suspend VM and save state to disk.' \ - 'suspend:Suspend VM and save state to disk.' \ - "down:Gracefully shutdown the VM." \ - "stop:Gracefully shutdown the VM." \ - "halt:Gracefully shutdown the VM." \ - "restart:Gracefully reboot the VM." \ - "poweroff:Forcefully power off the VM (might corrupt disk image)." \ - "reset:Forcefully power cycle the VM (might corrupt disk image)." \ - "delete:Delete boot2docker VM and its disk image." \ - "destroy:Delete boot2docker VM and its disk image." \ - "config:Show selected profile file settings." \ - "cfg:Show selected profile file settings." \ - "info:Display detailed information of VM." \ - "ip:Display the IP address of the VM's Host-only network." \ - "status:Display current state of VM." \ - "download:Download boot2docker ISO image." \ - "upgrade:Upgrade the boot2docker ISO image (if vm is running it will be stopped and started)." \ - "version:Display version information." - ) - - if (( CURRENT == 1 )); then - _describe -t commands 'boot2docker subcommand' _boot2docker_cmds - fi -} - -_boot2docker "$@" - -# Local Variables: -# mode: Shell-Script -# sh-indentation: 2 -# indent-tabs-mode: nil -# sh-basic-offset: 2 -# End: -# vim: ft=zsh sw=2 ts=2 et diff --git a/zsh/completion/_bower b/zsh/completion/_bower deleted file mode 100644 index 303b976..0000000 --- a/zsh/completion/_bower +++ /dev/null @@ -1,147 +0,0 @@ -#compdef bower -# ------------------------------------------------------------------------------ -# Description -# ----------- -# -# Completion script for Bower (http://bower.io). -# -# ------------------------------------------------------------------------------ -# Authors -# ------- -# -# * Joe Lencioni (https://github.com/lencioni) -# -# ------------------------------------------------------------------------------ - - -local curcontext="$curcontext" state line _packages _opts ret=1 - -_arguments -C -A "-v" -A "--version" \ - '(- 1 *)'{-v,--version}'[display version information]' \ - '1: :->cmds' \ - '*:: :->args' && ret=0 - -case $state in - cmds) - _values "bower command" \ - "cache[Manage bower cache]" \ - "help[Display help information about Bower]" \ - "home[Opens a package homepage into your favorite browser]" \ - "info[Info of a particular package]" \ - "init[Interactively create a bower.json file]" \ - "install[Install a package locally]" \ - "link[Symlink a package folder]" \ - "list[List local packages - and possible updates]" \ - "login[Authenticate with GitHub and store credentials]" \ - "lookup[Look up a package URL by name]" \ - "prune[Removes local extraneous packages]" \ - "register[Register a package]" \ - "search[Search for a package by name]" \ - "update[Update a local package]" \ - "uninstall[Remove a local package]" \ - "unregister[Remove a package from the registry]" \ - "version[Bump a package version]" - _arguments \ - '(--force)--force[Makes various commands more forceful]' \ - '(--json)--json[Output consumable JSON]' \ - '(--log-level)--log-level[What level of logs to report]' \ - '(--offline)--offline[Do not hit the network]' \ - '(--quiet)--quiet[Only output important information]' \ - '(--silent)--silent[Do not output anything, besides errors]' \ - '(--verbose)--verbose[Makes output more verbose]' \ - '(--allow-root)--allow-root[Allows running commands as root]' \ - '(--version)--version[Output Bower version]' \ - '(--no-color)--no-color[Disable colors]' - ret=0 - ;; - args) - case $line[1] in - help) - _values 'commands' \ - 'cache' \ - 'home' \ - 'info' \ - 'init' \ - 'install' \ - 'link' \ - 'list' \ - 'login' \ - 'lookup' \ - 'prune' \ - 'register' \ - 'search' \ - 'update' \ - 'uninstall' \ - 'unregister' \ - 'version' - ret=0 - ;; - (home|info|init|link|lookup|prune|register|search|unregister) - _arguments \ - '(--help)--help[Show help message]' - ret=0 - ;; - install) - _arguments \ - '(--force-latest)--force-latest[Force latest version on conflict]' \ - '(--help)--help[Show help message]' \ - '(--production)--production[Do not install project devDependencies]' \ - '(--save)--save[Save installed packages into the project''s bower.json dependencies]' \ - '(--save-dev)--save-dev[Save installed packages into the project''s bower.json devDependencies]' - ret=0 - ;; - list) - _arguments \ - '(--help)--help[Show help message]' \ - '(--paths)--paths[Generate a simple JSON source mapping]' \ - '(--relative)--relative[Make paths relative to the directory config property, which defaults to bower_components]' - ret=0 - ;; - login) - _arguments \ - '(--help)--help[Show help message]' \ - '(-t --token)'{-t,--token}'[Pass GitHub auth token (will not prompt for username/password)]' - ret=0 - ;; - uninstall) - _arguments \ - '(--help)--help[Show help message]' \ - '(--save)--save[Save installed packages into th projects''s bower.json dependencies]' \ - '(--save-dev)--save-dev[Save installed packages into th projects''s bower.json devDependencies]' - ret=0 - ;; - update) - _arguments \ - '(--force-latest)--force-latest[Force latest version on conflict]' \ - '(--help)--help[Show help message]' \ - '(--production)--production[Do not install project devDependencies]' - ret=0 - ;; - version) - _arguments \ - '(--message)--message[Custom git commit and tag message]' - ret=0 - ;; - exec) - _normal && ret=0 - ;; - *) - _opts=( $(bower help $line[1] | sed -e '/^ \[-/!d; s/^ \[\(-[^=]*\)=.*/\1/') ) - _opts+=( $(bower help $line[1] | sed -e '/^ -/!d; s/^ \(-.\), \[\(-[^=]*\)=.*/\1 \2/') ) - if [[ $_opts != "" ]]; then - _values 'options' $_opts && ret=0 - fi - ;; - esac - ;; -esac - -return ret - -# Local Variables: -# mode: Shell-Script -# sh-indentation: 2 -# indent-tabs-mode: nil -# sh-basic-offset: 2 -# End: -# vim: ft=zsh sw=2 ts=2 et diff --git a/zsh/completion/_docker-compose b/zsh/completion/_docker-compose deleted file mode 100644 index b333f4d..0000000 --- a/zsh/completion/_docker-compose +++ /dev/null @@ -1,197 +0,0 @@ -#compdef docker-compose -# ------------------------------------------------------------------------------ -# Description -# ----------- -# -# Completion script for Docker Compose (http://docs.docker.com/compose/). -# Adapted from boot2docker completion by hhatto (https://github.com/hhatto) -# and docker completion by @aeonazaan and @bobmaerten. -# -# ------------------------------------------------------------------------------ -# Authors -# ------- -# -# * ilkka (https://github.com/ilkka) -# -# ------------------------------------------------------------------------------ - -# helper function for getting *.yml (compose) files -__yml_files_in_current_dir() { - _values 'YAML files' *.yml -} - -# helper function for completing services in current project -__services() { - declare -a services_cmd - services_cmd=($(sed -n -E 's/^([^[:space:]][^:]*):/\1/p' docker-compose.yml | tr \\n ' ')) - _describe 'services' services_cmd -} - -# subcommands -local -a _docker_compose_cmds - -_docker_compose_cmds=( - 'build:Build or rebuild services' \ - 'help:Get help on a command' \ - 'kill:Kill containers' \ - 'logs:View output from containers' \ - 'port:Print the public port for a port binding' \ - 'ps:List containers' \ - 'pull:Pulls service images' \ - 'rm:Remove stopped containers' \ - 'run:Run a one-off command' \ - 'scale:Set number of containers for a service' \ - 'start:Start services' \ - 'stop:Stop services' \ - 'restart:Restart services' \ - 'up:Create and start containers' -) - -# subcommand completion functions -__build() { - _arguments \ - '--no-cache[Do not use cache when building image]' - __services -} - -__help() { - _values 'Get help for subcommand' \ - 'build' \ - 'help' \ - 'kill' \ - 'logs' \ - 'port' \ - 'ps' \ - 'pull' \ - 'rm' \ - 'run' \ - 'scale' \ - 'start' \ - 'stop' \ - 'restart' \ - 'up' -} - -__kill() { - _arguments \ - '-s[Signal to send instead of SIGKILL]' - __services -} - -__logs() { - _arguments \ - '--no-color[Monochrome output]' - __services -} - -__port() { - _arguments \ - '--protocol:protocol:(tcp udp)' \ - '--index[Index of container]:index' - __services -} - -__ps() { - _arguments \ - '-q[Only display IDs]' - __services -} - -__pull() { - _arguments \ - '--allow-insecure-ssl[Allow insecure connections to the docker registry]' - __services -} - -__rm() { - _arguments \ - "--force[Don't ask for confirmation]" \ - '-v[Remove volumes]' - __services -} - -__run() { - _arguments \ - '--allow-insecure-ssl[Allow insecure connections to the docker registry]' \ - '-d[Detached mode: Run container in the background, print new container name.]' \ - '--entrypoint[Override the entrypoint of the image.]:command:()' \ - '-e[Set an environment variable.]:key=val:()' \ - "--no-deps[Don't start linked services.]" \ - '--rm[Remove container after run. Ignored in detached mode.]' \ - "--service-ports[Run command with the service's ports enabled and mapped to the host.]" \ - '-T[Disable pseudo-tty allocation.]' - __services -} - -__scale() { - __services -} - -__start() { - __services -} - -__stop() { - __services -} - -__restart() { - __services -} - -__up() { - _arguments \ - '--allow-insecure-ssl[Allow insecure connections to the docker registry]' \ - '-d[Detached mode: Run containers in the background, print new container names.]' \ - '--no-color[Produce monochrome output.]' \ - "--no-deps[Don't start linked services.]" \ - "--no-recreate[If containers already exist, don't recreate them.]" \ - "--no-build[Don't build an image, even if it's missing]" - __services -} - -# common args -_arguments \ - '--verbose[Show more output]' \ - '--version[Print version and exit]' \ - '--file[Specify an alternate compose file]:__yml_files_in_current_dir' \ - '--project-name[Specify an alternate project name]:args' \ - '*:: :->command' - -# start machines! -if (( CURRENT == 1 )); then - _describe -t commands 'docker-compose command' _docker_compose_cmds -fi - -local -a _command_args -case "$words[1]" in - build) - __build ;; - help) - __help ;; - kill) - __kill ;; - logs) - __logs ;; - port) - __port ;; - ps) - __ps ;; - pull) - __pull ;; - rm) - __rm ;; - run) - __run ;; - scale) - __scale ;; - start) - __start ;; - stop) - __stop ;; - restart) - __restart ;; - up) - __up ;; -esac - diff --git a/zsh/completion/_docker-machine b/zsh/completion/_docker-machine deleted file mode 100644 index cf1cfbe..0000000 --- a/zsh/completion/_docker-machine +++ /dev/null @@ -1,294 +0,0 @@ -#compdef docker-machine -# ------------------------------------------------------------------------------ -# Description -# ----------- -# -# Completion script for Docker Machine (http://docs.docker.com/machine/). -# Adapted from boot2docker completion by hhatto (https://github.com/hhatto) -# and docker completion by @aeonazaan and @bobmaerten. -# -# ------------------------------------------------------------------------------ -# Authors -# ------- -# -# * ilkka (https://github.com/ilkka) -# -# ------------------------------------------------------------------------------ - -# helper function for completing available machines -__machines() { - declare -a machines_cmd - machines_cmd=($(docker-machine ls|tail +2|awk '{print $1":"$3"("$4")"}')) - _describe 'machines' machines_cmd -} - -# subcommands -local -a _docker_machine_cmds - -_docker_machine_cmds=( - 'active:Get or set the active machine' \ - 'create:Create a machine' \ - 'config:Print the connection config for machine' \ - 'inspect:Inspect information about a machine' \ - 'ip:Get the IP address of a machine' \ - 'kill:Kill a machine' \ - 'ls:List machines' \ - 'restart:Restart a machine' \ - 'rm:Remove a machine' \ - 'env:Display the commands to set up the environment for the Docker client' \ - 'ssh:Log into or run a command on a machine with SSH' \ - 'start:Start a machine' \ - 'stop:Stop a machine' \ - 'upgrade:Upgrade a machine to the latest version of Docker' \ - 'url:Get the URL of a machine' \ - 'help:Shows a list of commands or help for one command' -) - -# subcommand completion functions -__active() { - __machines -} - -__help() { - _values 'Get help for subcommand' \ - 'active' \ - 'create' \ - 'config' \ - 'inspect' \ - 'ip' \ - 'kill' \ - 'ls' \ - 'restart' \ - 'rm' \ - 'env' \ - 'ssh' \ - 'start' \ - 'stop' \ - 'upgrade' \ - 'url' \ - 'help' -} - -__create() { - _arguments \ - '--amazonec2-access-key:AWS Access Key:()' \ - '--amazonec2-ami:AWS machine image:()' \ - '--amazonec2-instance-type:AWS instance type:()' \ - '--amazonec2-region:AWS region:()' \ - '--amazonec2-root-size:AWS root disk size (in GB):()' \ - '--amazonec2-secret-key:AWS Secret Key:()' \ - '--amazonec2-security-group:AWS VPC security group:()' \ - '--amazonec2-session-token:AWS Session Token:()' \ - '--amazonec2-subnet-id:AWS VPC subnet id:()' \ - '--amazonec2-vpc-id:AWS VPC id:()' \ - '--amazonec2-zone:AWS zone for instance (i.e. a,b,c,d,e):()' \ - '--azure-docker-port:Azure Docker port:()' \ - '--azure-image:Azure image name. Default is Ubuntu 14.04 LTS x64:()' \ - '--azure-location:Azure location:()' \ - '--azure-password:Azure user password:()' \ - '--azure-publish-settings-file:Azure publish settings file:()' \ - '--azure-size:Azure size:()' \ - '--azure-ssh-port:Azure SSH port:()' \ - '--azure-subscription-cert:Azure subscription cert:()' \ - '--azure-subscription-id:Azure subscription ID:()' \ - '--azure-username:Azure username:()' \ - '--digitalocean-access-token:Digital Ocean access token:()' \ - '--digitalocean-image:Digital Ocean Image:()' \ - '--digitalocean-region:Digital Ocean region:()' \ - '--digitalocean-size:Digital Ocean size:()' \ - '--google-disk-size:GCE Instance Disk Size (in GB):()' \ - '--google-machine-type:GCE Machine Type:()' \ - '--google-project:GCE Project:()' \ - '--google-scopes:GCE Scopes (comma-separated if multiple scopes):()' \ - '--google-username:GCE User Name:()' \ - '--google-zone:GCE Zone:()' \ - '--openstack-auth-url:OpenStack authentication URL:()' \ - '--openstack-endpoint-type:OpenStack endpoint type (adminURL, internalURL or publicURL):()' \ - '--openstack-flavor-id:OpenStack flavor id to use for the instance:()' \ - '--openstack-flavor-name:OpenStack flavor name to use for the instance:()' \ - '--openstack-floatingip-pool:OpenStack floating IP pool to get an IP from to assign to the instance:()' \ - '--openstack-image-id:OpenStack image id to use for the instance:()' \ - '--openstack-image-name:OpenStack image name to use for the instance:()' \ - '--openstack-net-id:OpenStack image name to use for the instance:()' \ - '--openstack-net-name:OpenStack network name the machine will be connected on:()' \ - '--openstack-password:OpenStack password:()' \ - '--openstack-region:OpenStack region name:()' \ - '--openstack-sec-groups:OpenStack comma separated security groups for the machine:()' \ - '--openstack-ssh-port:OpenStack SSH port:()' \ - '--openstack-ssh-user:OpenStack SSH user:()' \ - '--openstack-tenant-id:OpenStack tenant id:()' \ - '--openstack-tenant-name:OpenStack tenant name:()' \ - '--openstack-username:OpenStack username:()' \ - '--rackspace-api-key:Rackspace API key:()' \ - '--rackspace-docker-install:Set if docker have to be installed on the machine:()' \ - '--rackspace-endpoint-type:Rackspace endpoint type (adminURL, internalURL or the default publicURL):()' \ - '--rackspace-flavor-id:Rackspace flavor ID. Default: General Purpose 1GB:()' \ - '--rackspace-image-id:Rackspace image ID. Default: Ubuntu 14.04 LTS (Trusty Tahr) (PVHVM):()' \ - '--rackspace-region:Rackspace region name:()' \ - '--rackspace-ssh-port:SSH port for the newly booted machine. Set to 22 by default:()' \ - '--rackspace-ssh-user:SSH user for the newly booted machine. Set to root by default:()' \ - '--rackspace-username:Rackspace account username:()' \ - '--softlayer-api-endpoint:softlayer api endpoint to use:()' \ - '--softlayer-api-key:softlayer user API key:()' \ - "--softlayer-cpu:number of CPUs for the machine:()" \ - '--softlayer-disk-size:Disk size for machine, a value of 0 uses the default size on softlayer:()' \ - '--softlayer-domain:domain name for machine:()' \ - '--softlayer-hostname:hostname for the machine:()' \ - '--softlayer-hourly-billing:set hourly billing for machine - on by default:()' \ - '--softlayer-image:OS image for machine:()' \ - '--softlayer-local-disk:use machine local disk instead of softlayer SAN:()' \ - '--softlayer-memory:Memory in MB for machine:()' \ - '--softlayer-private-net-only:Use only private networking:()' \ - '--softlayer-region:softlayer region for machine:()' \ - '--softlayer-user:softlayer user account name:()' \ - '--url:URL of host when no driver is selected:()' \ - '--virtualbox-boot2docker-url:The URL of the boot2docker image. Defaults to the latest available version:()' \ - '--virtualbox-disk-size:Size of disk for host in MB:()' \ - '--virtualbox-memory:Size of memory for host in MB:()' \ - '--vmwarefusion-boot2docker-url:Fusion URL for boot2docker image:()' \ - '--vmwarefusion-disk-size:Fusion size of disk for host VM (in MB):()' \ - '--vmwarefusion-memory-size:Fusion size of memory for host VM (in MB):()' \ - '--vmwarevcloudair-catalog:vCloud Air Catalog (default is Public Catalog):()' \ - '--vmwarevcloudair-catalogitem:vCloud Air Catalog Item (default is Ubuntu Precise):()' \ - '--vmwarevcloudair-computeid:vCloud Air Compute ID (if using Dedicated Cloud):()' \ - '--vmwarevcloudair-cpu-count:vCloud Air VM Cpu Count (default 1):()' \ - '--vmwarevcloudair-docker-port:vCloud Air Docker port:()' \ - '--vmwarevcloudair-edgegateway:vCloud Air Org Edge Gateway (Default is ):()' \ - '--vmwarevcloudair-memory-size:vCloud Air VM Memory Size in MB (default 2048):()' \ - '--vmwarevcloudair-orgvdcnetwork:vCloud Air Org VDC Network (Default is -default-routed):()' \ - '--vmwarevcloudair-password:vCloud Air password:()' \ - '--vmwarevcloudair-provision:vCloud Air Install Docker binaries (default is true):()' \ - '--vmwarevcloudair-publicip:vCloud Air Org Public IP to use:()' \ - '--vmwarevcloudair-ssh-port:vCloud Air SSH port:()' \ - '--vmwarevcloudair-username:vCloud Air username:()' \ - '--vmwarevcloudair-vdcid:vCloud Air VDC ID:()' \ - '--vmwarevsphere-boot2docker-url:vSphere URL for boot2docker image:()' \ - '--vmwarevsphere-compute-ip:vSphere compute host IP where the docker VM will be instantiated:()' \ - '--vmwarevsphere-cpu-count:vSphere CPU number for docker VM:()' \ - '--vmwarevsphere-datacenter:vSphere datacenter for docker VM:()' \ - '--vmwarevsphere-datastore:vSphere datastore for docker VM:()' \ - '--vmwarevsphere-disk-size:vSphere size of disk for docker VM (in MB):()' \ - '--vmwarevsphere-memory-size:vSphere size of memory for docker VM (in MB):()' \ - '--vmwarevsphere-network:vSphere network where the docker VM will be attached:()' \ - '--vmwarevsphere-password:vSphere password:()' \ - '--vmwarevsphere-pool:vSphere resource pool for docker VM:()' \ - '--vmwarevsphere-username:vSphere username:()' \ - '--vmwarevsphere-vcenter:vSphere IP/hostname for vCenter:()' \ - '--driver:Driver to create machine with.:(amazonec2 azure digitalocean google none openstack rackspace softlayer virtualbox vmwarefusion vmwarevcloudair vmwarevsphere)' \ - '--swarm:Configure Machine with Swarm:()' \ - '--swarm-master:Configure Machine to be a Swarm master:()' \ - '--swarm-discovery:Discovery service to use with Swarm:()' \ - '--swarm-host:ip/socket to listen on for Swarm master:()' \ - '--swarm-addr:addr to advertise for Swarm (default: detect and use the machine IP):()' -} - -__config() { - _arguments \ - '--swarm[Display the Swarm config instead of the Docker daemon]' - __machines -} - -__inspect() { - __machines -} - -__ip() { - __machines -} - -__env() { - _arguments \ - '--unset[Unset variables instead of setting them]' \ - '--swarm[Display the Swarm config instead of the Docker daemon]' - __machines -} - -__kill() { - __machines -} - -__ls() { - _arguments \ - '--quiet[Enable quiet mode]' -} - -__restart() { - __machines -} - -__start() { - __machines -} - -__stop() { - __machines -} - -__rm() { - __machines -} - -__ssh() { - __machines -} - -__upgrade() { - __machines -} - -__url() { - __machines -} - -# common args -_arguments \ - '--debug[Enable debug mode]' \ - '--storage-path[Configures storage path]:_files' \ - '--tls-ca-cert[CA to verify remotes against]:_files' \ - '--tls-ca-key[Private key to generate certificates]:_files' \ - '--tls-client-cert[Client cert to use for TLS]:_files' \ - '--tls-client-key[Private key used in client TLS auth]:_files' \ - '--help[show help]' \ - '--version[print the version]' \ - '*:: :->command' - -# start machines! -if (( CURRENT == 1 )); then - _describe -t commands 'docker-machine command' _docker_machine_cmds -fi - -local -a _command_args -case "$words[1]" in - active) - __active ;; - create) - __create ;; - config) - __config ;; - inspect) - __inspect ;; - ip) - __ip ;; - kill) - __kill ;; - ls) - __ls ;; - restart) - __restart ;; - rm) - __rm ;; - env) - __env ;; - ssh) - __ssh ;; - start) - __start ;; - stop) - __stop ;; - upgrade) - __upgrade ;; - url) - __url ;; - help) - __help ;; -esac diff --git a/zsh/completion/_rvm b/zsh/completion/_rvm deleted file mode 100644 index 2a600e7..0000000 --- a/zsh/completion/_rvm +++ /dev/null @@ -1,127 +0,0 @@ -#compdef rvm -# ------------------------------------------------------------------------------ -# Description -# ----------- -# -# Completion script for rvm (https://rvm.beginrescueend.com/). -# -# Source: https://github.com/wayneeseguin/rvm/blob/master/scripts/zsh/Completion/_rvm -# -# ------------------------------------------------------------------------------ -# Authors -# ------- -# -# * Bruno Michel (https://github.com/nono) -# -# ------------------------------------------------------------------------------ - -local curcontext="$curcontext" state line cmds ret=1 - -_arguments -C \ - '(- 1 *)'{-v,--version}'[display version information]' \ - '(-l --level)'{-l,--level}'+[patch level to use with rvm use / install]:number' \ - '--bin[path for binaries to be placed (~/.rvm/bin/)]:path:_files' \ - '--source[src directory to use (~/.rvm/src/)]:path:_files' \ - '--archives[directory for downloaded files (~/.rvm/archives/)]:path:_files' \ - '-S[Specify a script file to attempt to load and run (rubydo)]:file:_files' \ - '-e[Execute code from the command line]:code' \ - '-G[root gem path to use]:path:_files' \ - '--gems[Used to set the gems_flag, use with remove to remove gems]' \ - '--archive[Used to set the archive_flag, use with remove to remove archive]' \ - '--patch[With MRI Rubies you may specify one or more full paths to patches]:paths:->patches' \ - '(-C --configure)'{-C,--configure}'=[custom configure options]' \ - '--nice[process niceness (for slow computers, default 0)]:number' \ - '--ree-options[Options passed directly to ree ./installer on the command line]:options' \ - '--head[with update, updates rvm to git head version]' \ - '--rubygems[with update, updates rubygems for selected ruby]' \ - '--default[with ruby select, sets a default ruby for new shells]' \ - '--debug[Toggle debug mode on for very verbose output]' \ - '--trace[Toggle trace mode on to see EVERYTHING rvm is doing]' \ - '--force[Force install, even given ruby is already install]' \ - '--summary[Used with rubydo to print out a summary of the commands run]' \ - '--latest[with gemset --dump skips version strings for latest gem]' \ - '--gems[with uninstall/remove removes gems with the interpreter]' \ - '--docs[with install, attempt to generate ri after installation]' \ - '--reconfigure[Force ./configure on install even if Makefile already exists]' \ - '1: :->cmds' \ - '*: :->args' && ret=0 - -case $state in - - patches) - compset -P '*,' - compset -S ',*' - _files -q -S , - ;; - - cmds) - - cmds=( ${(f)"$(_call_program commands rvm help 2> /dev/null | __rvm_sed -e '/^== Action/,/^== Implementation/!d; / :: /!d; s/^[ *]*\([^ ]*\) *:: *\(.*\)/\1:\2/')"} ) - cmds+=( $(rvm list strings) ) - _describe -t commands 'rvm command' cmds && ret=0 - ;; - - args) - - case $line[1] in - - (use|uninstall|remove|list) - - if (( CURRENT == 3 )); then - # See if we’ve made it to the ‘@’; eg, 1.9.2@ - if ! __rvm_grep '@' <<< "${line[CURRENT-1]}" >/dev/null ; then - _values -S , 'rubies' \ - $(rvm list strings | __rvm_sed -e 's/ruby-\([^) ]*\)-\([^) ]*\)/ruby-\1-\2 \1-\2 \1/g') \ - default system $(rvm alias list names) && ret=0 - else - # Construct a full version string for each of the gemsets. - # Eg, 1.9.2@min 1.9.2@rail3 … - _values -S , 'gemsets' \ - $(rvm ${line[CURRENT-1]%%@*} gemset list | __rvm_awk '/^[ -_[:alnum:]]+$/ {print "'${line[CURRENT-1]%%@*}'@"$1}') - fi - fi - ;; - - (install|fetch) - - _values -S , 'rubies' $(rvm list known_strings) && ret=0 - ;; - - gemset) - - if (( CURRENT == 3 )); then - _values 'gemset_commands' $(rvm gemset help | __rvm_sed -e '/create/!d; s/^.*[{]\(.*\)[}].*$/\1/; s/,/ /g') - else - #_values -S , 'gemsets' $(rvm gemset list | __rvm_grep -v gemset 2>/dev/null) - _values -S , 'gemsets' $(rvm gemset list | __rvm_grep -Ev '(gemset|info)' 2>/dev/null | __rvm_awk '/^[ -_[:alnum:]]+$/ {print '$1'}') - fi - ret=0 - ;; - - package) - - if (( CURRENT == 3 )); then - _values 'package_commands' $(rvm package | __rvm_sed -e '/Usage/!d; s/^.*[{]\(.*\)[}] [{].*$/\1/; s/,/ /g') - else - _values 'packages' $(rvm package | __rvm_sed -e '/Usage/!d; s/^.*[}] [{]\(.*\)[}].*$/\1/; s/,/ /g') - fi - ret=0 - ;; - - *) - (( ret )) && _message 'no more arguments' - ;; - - esac - ;; -esac - -return ret - -# Local Variables: -# mode: Shell-Script -# sh-indentation: 2 -# indent-tabs-mode: nil -# sh-basic-offset: 2 -# End: -# vim: ft=zsh sw=2 ts=2 et diff --git a/zsh/themes/peepcode.theme b/zsh/themes/peepcode.theme index 6797433..0479452 100644 --- a/zsh/themes/peepcode.theme +++ b/zsh/themes/peepcode.theme @@ -52,6 +52,9 @@ PROMPT=' %~ ${smiley} %{$reset_color%}' -RPROMPT='%{$fg[white]%} ruby-$(mise current ruby 2>/dev/null) node-$(mise current node 2>/dev/null)$(git_prompt)%{$reset_color%}' +mise_ruby() { command -v mise > /dev/null && mise current ruby 2>/dev/null | sed 's/^/ruby-/'; } +mise_node() { command -v mise > /dev/null && mise current node 2>/dev/null | sed 's/^/node-/'; } + +RPROMPT='%{$fg[white]%} $(mise_ruby) $(mise_node)$(git_prompt)%{$reset_color%}' # vi: set ft=zsh : diff --git a/zshenv b/zshenv index e149831..d498b85 100644 --- a/zshenv +++ b/zshenv @@ -8,7 +8,7 @@ export CC_GOOD_COMMAND="☻" export CC_BAD_COMMAND="☻" # ensure dotfiles bin directory is loaded first -export PATH="$HOME/.bin:/usr/local/sbin:$PATH" +export PATH="$HOME/.local/bin:$HOME/.bin:/usr/local/sbin:$PATH" # Local config [[ -f ~/.zshenv.local ]] && source ~/.zshenv.local diff --git a/zshrc b/zshrc index ef2a910..f86502e 100644 --- a/zshrc +++ b/zshrc @@ -22,8 +22,8 @@ export CLICOLOR=1 # history settings setopt hist_ignore_all_dups inc_append_history HISTFILE=~/.zhistory -HISTSIZE=4096 -SAVEHIST=4096 +HISTSIZE=50000 +SAVEHIST=50000 # awesome cd movements from zshkit setopt autocd autopushd pushdminus pushdsilent pushdtohome cdablevars @@ -56,8 +56,10 @@ set -o nobeep # no annoying beeps [[ -f ~/.aliases ]] && source ~/.aliases # Zsh syntax highlight -source ~/.zsh-syntax-highlighting/zsh-syntax-highlighting.zsh -TERM=screen-256color +[[ -f ~/.zsh-syntax-highlighting/zsh-syntax-highlighting.zsh ]] && source ~/.zsh-syntax-highlighting/zsh-syntax-highlighting.zsh +if [[ "$(uname)" == "Linux" ]]; then + TERM=screen-256color +fi # Local config [[ -f ~/.zshrc.local ]] && source ~/.zshrc.local @@ -71,4 +73,4 @@ source ~/.zsh/themes/peepcode.theme setopt interactivecomments # Load mise (Ruby, Node.js version manager) -eval "$(~/.local/bin/mise activate zsh)" +[[ -f ~/.local/bin/mise ]] && eval "$(~/.local/bin/mise activate zsh)" From 6a811db419dab46a8237699834a2044a445fc07e Mon Sep 17 00:00:00 2001 From: "Alan Rafael R. Batista" Date: Sat, 21 Mar 2026 21:05:40 -0300 Subject: [PATCH 17/29] Update vim plugins: replace syntastic with ALE, fix repo references MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - scrooloose/nerdtree → preservim/nerdtree (repo renamed) - scrooloose/syntastic → dense-analysis/ale (async linting) - vim-scripts/tComment → tomtom/tcomment_vim (correct repo) - Remove syntastic config from vimrc - Fix p conflict: remove CtrlP binding, keep clipboard paste --- vim/plugins.vim | 6 +++--- vim/settings/key_mappings.vim | 1 - vimrc | 6 ------ 3 files changed, 3 insertions(+), 10 deletions(-) diff --git a/vim/plugins.vim b/vim/plugins.vim index fdd9815..1b585ff 100644 --- a/vim/plugins.vim +++ b/vim/plugins.vim @@ -8,10 +8,10 @@ call plug#begin('~/.vim/bundle') Plug 'christoomey/vim-tmux-navigator' Plug 'lifepillar/vim-solarized8' Plug 'gruvbox-community/gruvbox' " default colorscheme -Plug 'scrooloose/nerdtree' " file explorer +Plug 'preservim/nerdtree' " file explorer Plug 'ctrlpvim/ctrlp.vim' " fuzzy finder Plug 'pbrisbin/vim-mkdir' " create folder if it doesn't exist -Plug 'scrooloose/syntastic' " syntax checking +Plug 'dense-analysis/ale' " async linting Plug 'thoughtbot/vim-rspec' Plug 'tpope/vim-endwise' Plug 'tpope/vim-fugitive' @@ -20,7 +20,7 @@ Plug 'tpope/vim-rails' Plug 'keith/rspec.vim' Plug 'tpope/vim-surround' Plug 'vim-ruby/vim-ruby' -Plug 'vim-scripts/tComment' +Plug 'tomtom/tcomment_vim' Plug 'chrisbra/color_highlight' Plug 'tmux-plugins/vim-tmux' Plug 'vim-airline/vim-airline' " Pretty status bar diff --git a/vim/settings/key_mappings.vim b/vim/settings/key_mappings.vim index d6292e0..f1716b0 100644 --- a/vim/settings/key_mappings.vim +++ b/vim/settings/key_mappings.vim @@ -43,7 +43,6 @@ noremap hl :set hlsearch! hlsearch? " CtrlP nnoremap t :CtrlP -nnoremap p :CtrlP nnoremap b :CtrlPBuffer nnoremap m :CtrlPMRU diff --git a/vimrc b/vimrc index 40c8f69..77848a6 100644 --- a/vimrc +++ b/vimrc @@ -108,12 +108,6 @@ let g:Tlist_Ctags_Cmd="ctags --exclude='*.js'" " Treat
  • and

    tags like the block tags they are let g:html_indent_tags = 'li\|p' -" configure syntastic syntax checking to check on open as well as save -let g:syntastic_check_on_open=1 -let g:syntastic_html_tidy_ignore_errors=[" proprietary attribute \"ng-"] -let g:syntastic_eruby_ruby_quiet_messages = - \ {"regex": "possibly useless use of a variable in void context"} - " automatically rebalance windows on vim resize autocmd VimResized * :wincmd = From 28be23777d048194a06c7b1395a051a1215d9943 Mon Sep 17 00:00:00 2001 From: "Alan Rafael R. Batista" Date: Sat, 21 Mar 2026 21:23:32 -0300 Subject: [PATCH 18/29] Update gitconfig: fix deprecated stash save, Gdiff, and push default MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - git stash save → git stash push (deprecated since git 2.16) - Gdiff → Gdiffsplit (deprecated in fugitive) - push.default upstream → simple (safer, refuses push on name mismatch) --- git/gitconfig | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/git/gitconfig b/git/gitconfig index e2a70ed..01f2272 100644 --- a/git/gitconfig +++ b/git/gitconfig @@ -16,7 +16,7 @@ chunkyadd = add --patch # stage commits chunk by chunk # via http://blog.apiaxle.com/post/handy-git-tips-to-stop-you-getting-fired/ - snapshot = !git stash save "snapshot: $(date)" && git stash apply "stash@{0}" + snapshot = !git stash push -m "snapshot: $(date)" && git stash apply "stash@{0}" snapshots = !git stash list --grep snapshot #via http://stackoverflow.com/questions/5188320/how-can-i-get-a-list-of-git-branches-ordered-by-most-recent-commit @@ -89,7 +89,7 @@ [mergetool] prompt = false [mergetool "vimdiff"] - cmd="vim -c 'Gdiff' $MERGED" # use fugitive.vim for 3-way merge + cmd="vim -c 'Gdiffsplit' $MERGED" # use fugitive.vim for 3-way merge keepbackup=false [merge] summary = true @@ -104,7 +104,7 @@ [push] # 'git push' will push the current branch to its tracking branch # the usual default is to push all branches - default = upstream + default = simple [core] autocrlf = false editor = vim From 61985de32012941c4d8707ad0134e64c49281e14 Mon Sep 17 00:00:00 2001 From: "Alan Rafael R. Batista" Date: Sat, 21 Mar 2026 21:26:32 -0300 Subject: [PATCH 19/29] Update pryrc for modern Pry, remove CodeRay color customization - Use Pry::Prompt.new API (Pry 0.13+) with fallback for older versions - Replace awesome_print with amazing_print (with fallback) - Use modern .pry! integration instead of deprecated Pry.config.print - Remove CodeRay customization and color files (no longer used by Pry) - Update RVM reference to mise in comments --- irb/escaped_colors.rb | 68 ----------------------------- irb/pryrc | 94 ++++++++++++----------------------------- irb/unescaped_colors.rb | 68 ----------------------------- 3 files changed, 27 insertions(+), 203 deletions(-) delete mode 100644 irb/escaped_colors.rb delete mode 100644 irb/unescaped_colors.rb diff --git a/irb/escaped_colors.rb b/irb/escaped_colors.rb deleted file mode 100644 index e1ba28d..0000000 --- a/irb/escaped_colors.rb +++ /dev/null @@ -1,68 +0,0 @@ -TERM_TOKEN_COLORS = { - :attribute_name => "\e[33m", - :attribute_value => "\e[31m", - :binary => "\e[1;35m", - :char => { - :self => "\e[36m", :delimiter => "\e[34m" - }, - :class => "\e[1;35m", - :class_variable => "\e[36m", - :color => "\e[32m", - :comment => "\e[37m", - :complex => "\e[34m", - :constant => "\e[34m\e[4m", - :decoration => "\e[35m", - :definition => "\e[1;32m", - :directive => "\e[32m\e[4m", - :doc => "\e[46m", - :doctype => "\e[1;30m", - :doc_string => "\e[31m\e[4m", - :entity => "\e[33m", - :error => "\e[1;33m\e[41m", - :exception => "\e[1;31m", - :float => "\e[1;35m", - :function => "\e[1;34m", - :global_variable => "\e[42m", - :hex => "\e[1;36m", - :include => "\e[33m", - :integer => "\e[1;34m", - :key => "\e[35m", - :label => "\e[1;15m", - :local_variable => "\e[33m", - :octal => "\e[1;35m", - :operator_name => "\e[1;29m", - :predefined_constant => "\e[1;36m", - :predefined_type => "\e[1;30m", - :predefined => "\e[4m\e[1;34m", - :preprocessor => "\e[36m", - :pseudo_class => "\e[34m", - :regexp => { - :self => "\e[31m", - :content => "\e[31m", - :delimiter => "\e[1;29m", - :modifier => "\e[35m", - :function => "\e[1;29m" - }, - :reserved => "\e[1;31m", - :shell => { - :self => "\e[42m", - :content => "\e[1;29m", - :delimiter => "\e[37m", - }, - :string => { - :self => "\e[36m", - :modifier => "\e[1;32m", - :escape => "\e[1;36m", - :delimiter => "\e[1;32m", - }, - :symbol => "\e[1;31m", - :tag => "\e[34m", - :type => "\e[1;34m", - :value => "\e[36m", - :variable => "\e[34m", - - :insert => "\e[42m", - :delete => "\e[41m", - :change => "\e[44m", - :head => "\e[45m" -} diff --git a/irb/pryrc b/irb/pryrc index dfecc17..520320b 100644 --- a/irb/pryrc +++ b/irb/pryrc @@ -7,14 +7,26 @@ Pry.commands.alias_command 's', 'step' rescue nil Pry.commands.alias_command 'n', 'next' rescue nil # === CUSTOM PROMPT === -# This prompt shows the ruby version (useful for RVM) -Pry.prompt = [proc { |obj, nest_level, _| "#{RUBY_VERSION} (#{obj}):#{nest_level} > " }, proc { |obj, nest_level, _| "#{RUBY_VERSION} (#{obj}):#{nest_level} * " }] +# This prompt shows the ruby version (useful for mise) +if Pry::Prompt.respond_to?(:new) + Pry.config.prompt = Pry::Prompt.new( + 'cc', + 'Campus Code prompt', + [ + proc { |obj, nest_level, _| "#{RUBY_VERSION} (#{obj}):#{nest_level} > " }, + proc { |obj, nest_level, _| "#{RUBY_VERSION} (#{obj}):#{nest_level} * " } + ] + ) +else + Pry.prompt = [ + proc { |obj, nest_level, _| "#{RUBY_VERSION} (#{obj}):#{nest_level} > " }, + proc { |obj, nest_level, _| "#{RUBY_VERSION} (#{obj}):#{nest_level} * " } + ] +end # === Listing config === -# Better colors - by default the headings for methods are too +# Better colors - by default the headings for methods are too # similar to method name colors leading to a "soup" -# These colors are optimized for use with Solarized scheme -# for your terminal Pry.config.ls.separator = "\n" # new lines between methods Pry.config.ls.heading_color = :magenta Pry.config.ls.public_method_color = :green @@ -22,44 +34,20 @@ Pry.config.ls.protected_method_color = :yellow Pry.config.ls.private_method_color = :bright_black # == PLUGINS === -# awesome_print gem: great syntax colorized printing +# amazing_print gem: great syntax colorized printing (formerly awesome_print) begin - require 'awesome_print' - # The following line enables awesome_print for all pry output, - # and it also enables paging - Pry.config.print = proc {|output, value| Pry::Helpers::BaseHelpers.stagger_output("=> #{value.ai}", output)} - AwesomePrint.defaults = { - :indent => 2, - :sort_keys => true, - :color => { - :args => :greenish, - :array => :pale, - :bigdecimal => :blue, - :class => :yellow, - :date => :greenish, - :falseclass => :red, - :fixnum => :blue, - :float => :blue, - :hash => :pale, - :keyword => :cyan, - :method => :purpleish, - :nilclass => :red, - :string => :yellowish, - :struct => :pale, - :symbol => :cyanish, - :time => :greenish, - :trueclass => :green, - :variable => :cyanish - } - } - # If you want awesome_print without automatic pagination, use the line below - # Pry.config.print = proc { |output, value| output.puts value.ai } -rescue LoadError => err - puts "gem install awesome_print # <-- highly recommended" + require 'amazing_print' + AmazingPrint.pry! +rescue LoadError + begin + require 'awesome_print' + AwesomePrint.pry! + rescue LoadError + # no pretty printer available + end end # === CUSTOM COMMANDS === -# from: https://gist.github.com/1297510 default_command_set = Pry::CommandSet.new do command "copy", "Copy argument to the clip-board" do |str| IO.popen('pbcopy', 'w') { |f| f << str.to_s } @@ -92,9 +80,7 @@ end Pry.config.commands.import default_command_set - # === CONVENIENCE METHODS === -# Stolen from https://gist.github.com/807492 # Use Array.toy or Hash.toy to get an array or hash to play with class Array def self.toy(n=10, &block) @@ -108,30 +94,4 @@ class Hash end end -# === COLOR CUSTOMIZATION === -# Everything below this line is for customizing colors, you have to use the ugly -# color codes, but such is life. -CodeRay.scan("example", :ruby).term # just to load necessary files -# Token colors pulled from: https://github.com/rubychan/coderay/blob/master/lib/coderay/encoders/terminal.rb - -$LOAD_PATH << File.dirname(File.realpath(__FILE__)) - -# In CodeRay >= 1.1.0 token colors are defined as pre-escaped ANSI codes -if Gem::Version.new(CodeRay::VERSION) >= Gem::Version.new('1.1.0') - require "escaped_colors" -else - require "unescaped_colors" -end - -module CodeRay - module Encoders - class Terminal < Encoder - # override old colors - TERM_TOKEN_COLORS.each_pair do |key, value| - TOKEN_COLORS[key] = value - end - end - end -end - # vim: set ft=ruby : diff --git a/irb/unescaped_colors.rb b/irb/unescaped_colors.rb deleted file mode 100644 index 6580fc5..0000000 --- a/irb/unescaped_colors.rb +++ /dev/null @@ -1,68 +0,0 @@ -TERM_TOKEN_COLORS = { - :attribute_name => '33', - :attribute_value => '31', - :binary => '1;35', - :char => { - :self => '36', :delimiter => '34' - }, - :class => '1;35', - :class_variable => '36', - :color => '32', - :comment => '37', - :complex => '34', - :constant => ['34', '4'], - :decoration => '35', - :definition => '1;32', - :directive => ['32', '4'], - :doc => '46', - :doctype => '1;30', - :doc_string => ['31', '4'], - :entity => '33', - :error => ['1;33', '41'], - :exception => '1;31', - :float => '1;35', - :function => '1;34', - :global_variable => '42', - :hex => '1;36', - :include => '33', - :integer => '1;34', - :key => '35', - :label => '1;15', - :local_variable => '33', - :octal => '1;35', - :operator_name => '1;29', - :predefined_constant => '1;36', - :predefined_type => '1;30', - :predefined => ['4', '1;34'], - :preprocessor => '36', - :pseudo_class => '34', - :regexp => { - :self => '31', - :content => '31', - :delimiter => '1;29', - :modifier => '35', - :function => '1;29' - }, - :reserved => '1;31', - :shell => { - :self => '42', - :content => '1;29', - :delimiter => '37', - }, - :string => { - :self => '36', - :modifier => '1;32', - :escape => '1;36', - :delimiter => '1;32', - }, - :symbol => '1;31', - :tag => '34', - :type => '1;34', - :value => '36', - :variable => '34', - - :insert => '42', - :delete => '41', - :change => '44', - :head => '45' -} From a635659435e3af2491a694aa3de70a4e8f49e790 Mon Sep 17 00:00:00 2001 From: "Alan Rafael R. Batista" Date: Sat, 21 Mar 2026 21:29:54 -0300 Subject: [PATCH 20/29] Remove reattach-to-user-namespace from tmux copy mode on macOS MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit No longer needed since tmux 2.6+ — pbcopy works natively in tmux. --- templates/copy_mode_mac.conf.tmp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/templates/copy_mode_mac.conf.tmp b/templates/copy_mode_mac.conf.tmp index 88f598f..513258f 100644 --- a/templates/copy_mode_mac.conf.tmp +++ b/templates/copy_mode_mac.conf.tmp @@ -1,11 +1,9 @@ -# Patch for OS X pbpaste and pbcopy under tmux. -set-option -g default-command "which reattach-to-user-namespace > /dev/null && reattach-to-user-namespace -l $SHELL || $SHELL" # Setup 'v' to begin selection as in Vim bind-key -T copy-mode-vi v send-keys -X begin-selection -bind-key -T copy-mode-vi y send-keys -X copy-pipe-and-cancel "reattach-to-user-namespace pbcopy" +bind-key -T copy-mode-vi y send-keys -X copy-pipe-and-cancel "pbcopy" bind-key -T copy-mode-vi C-v send-keys -X rectangle-toggle -# # Update default binding of `Enter` to also use copy-pipe +# Update default binding of `Enter` to also use copy-pipe unbind-key -T copy-mode-vi Enter -bind-key -T copy-mode-vi Enter send-keys -X copy-pipe-and-cancel "reattach-to-user-namespace pbcopy" +bind-key -T copy-mode-vi Enter send-keys -X copy-pipe-and-cancel "pbcopy" # vi: set ft=tmux : From acacbfcf9df08ad46cd49bc958763c91650ac561 Mon Sep 17 00:00:00 2001 From: "Alan Rafael R. Batista" Date: Sat, 21 Mar 2026 21:31:19 -0300 Subject: [PATCH 21/29] Rewrite README.md and update CLAUDE.md to reflect all changes README rewritten with clearer structure: what's included, install instructions using bash (not sh), customization table, key conventions, and links to testing docs. CLAUDE.md updated with testing section, mise references, and corrected push default. --- CLAUDE.md | 34 ++++++++++++++-------- README.md | 84 ++++++++++++++++++++++++++++++++----------------------- 2 files changed, 72 insertions(+), 46 deletions(-) diff --git a/CLAUDE.md b/CLAUDE.md index 3d6e9be..3210329 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -4,26 +4,37 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co ## Overview -This is **Campus Code Dotfiles (cc_dotfiles)** — a shared dotfiles distribution for zsh, vim, tmux, and git, inspired by [skwp/dotfiles](https://github.com/skwp/dotfiles) and [thoughtbot/dotfiles](https://github.com/thoughtbot/dotfiles). It targets macOS and Ubuntu. +This is **Campus Code Dotfiles (cc_dotfiles)** — a shared dotfiles distribution for zsh, vim, tmux, and git, targeting macOS and Ubuntu. ## Installation ```bash # Remote install (clones to ~/.cc_dotfiles, then runs rake install) -sh -c "$(curl -fSs https://raw.githubusercontent.com/campuscode/cc_dotfiles/master/install.sh)" +bash -c "$(curl -fSs https://raw.githubusercontent.com/campuscode/cc_dotfiles/master/install.sh)" -# Local install -LOCAL_INSTALL=1 ./install.sh +# Local install (from a cloned repo) +LOCAL_INSTALL=1 bash install.sh ``` -The `rake install` task symlinks config files into `~/` (prefixed with `.`), installs fonts, vim-plug plugins, zsh-syntax-highlighting, tmux-battery plugin, and changes the default shell to zsh. +The `install.sh` installs system dependencies, sets up mise (Ruby/Node.js), then copies the repo to `~/.cc_dotfiles` and runs `rake install`. The Rake task symlinks config files into `~/` (prefixed with `.`), installs fonts, vim-plug plugins, zsh-syntax-highlighting, tmux-battery plugin, and changes the default shell to zsh. + +## Testing + +Tests run in isolated VMs to avoid affecting the host machine: +- **macOS**: Vagrant + UTM plugin with Ubuntu 24.04 Desktop (`vagrant up --provider=utm`) +- **Linux**: Multipass with Ubuntu 24.04 (`./tests/test_linux.sh`) + +See [tests/README.md](tests/README.md) for detailed setup instructions. ## Architecture -**Rakefile** is the main installer — it symlinks files, installs prerequisites via `mac.sh` or `ubuntu.sh`, and sets up plugins. All dotfiles are symlinked from this repo into `$HOME` as hidden files (e.g., `aliases` → `~/.aliases`). +**install.sh** is the entry point — installs system packages, mise, Ruby, and Node.js, then copies the repo and runs `rake install`. + +**Rakefile** is the installer — symlinks files, runs `mac.sh` or `ubuntu.sh` for platform-specific prerequisites, and sets up plugins. + +**mac.sh / ubuntu.sh** install platform-specific dependencies (Homebrew packages on macOS, Docker/tmux/Gogh on Ubuntu). -**Customization layer**: Every config file sources a `.local` counterpart if present. Users should put personal overrides in these files rather than modifying the repo directly: -- `~/.aliases.local`, `~/.zshrc.local`, `~/.zshenv.local`, `~/.vimrc.local`, `~/.plugins.vim.local`, `~/.tmux.conf.local`, `~/.gitconfig.local`, `~/.secrets` +**Customization layer**: Every config file sources a `.local` counterpart if present. Users put personal overrides in `.local` files rather than modifying the repo. **Key conventions**: - Vim leader key is `` @@ -31,10 +42,11 @@ The `rake install` task symlinks config files into `~/` (prefixed with `.`), ins - Zsh uses vi mode with `jj` bound to escape - Default colorscheme is gruvbox (dark background) - Vim plugin manager is [vim-plug](https://github.com/junegunn/vim-plug) (`~/.vim/plugins.vim`) -- Vim settings are auto-loaded from individual files in `vim/settings/*.vim` +- Vim settings are auto-loaded from `vim/settings/*.vim` - Zsh functions are auto-loaded from `zsh/functions/*` - Zsh theme is `peepcode` (`zsh/themes/peepcode.theme`) +- Ruby and Node.js managed by [mise](https://mise.jdx.dev) -**Shell aliases** (`aliases`): extensive git shortcuts (e.g., `gs`=status, `gco`=checkout, `gp`=push, `gpsh`=push current branch), docker-compose aliases (`dc`, `dcr`, `dcup`), and Rails/Ruby aliases (`rc`, `rs`, `rdm`). +**Shell aliases** (`aliases`): git shortcuts (`gs`=status, `gco`=checkout, `gp`=push, `gpsh`=push current branch), docker compose aliases (`dc`, `dcr`, `dcup`), and Rails/Ruby aliases (`rc`, `rs`, `rdm`). -**Git config** (`git/gitconfig`): uses patience diff algorithm, vimdiff as merge tool, rerere enabled, push default is `upstream`. Local overrides via `~/.gitconfig.local`. +**Git config** (`git/gitconfig`): patience diff algorithm, vimdiff as merge tool, rerere enabled, push default is `simple`. Local overrides via `~/.gitconfig.local`. diff --git a/README.md b/README.md index 4853898..80f731c 100644 --- a/README.md +++ b/README.md @@ -1,58 +1,72 @@ -CAMPUS CODE Dotfiles -==================== +# Campus Code Dotfiles ![](https://i.imgur.com/XogkB7V.png) -## Source of inspiration +A shared dotfiles distribution for **zsh**, **vim**, **tmux**, and **git**, targeting macOS and Ubuntu. -Our dotfiles are based on following amazing dotfiles: +Inspired by [Skwp Dotfiles](https://github.com/skwp/dotfiles) and [ThoughtBot Dotfiles](https://github.com/thoughtbot/dotfiles). -[Skwp Dotfiles](http://github.com/skwp/dotfiles) +## What's included -[ThoughtBot Dotfiles](http://github.com/thoughtbot/dotfiles) +- **Zsh** with vi mode, custom theme (peepcode), syntax highlighting, and extensive aliases +- **Vim** with vim-plug, gruvbox colorscheme, ALE linting, NERDTree, CtrlP, and tmux integration +- **Tmux** with `C-a` prefix, vim-aware pane navigation, battery status, and vi copy mode +- **Git** with aliases, patience diff, vimdiff merge tool, and rerere enabled +- **mise** for Ruby and Node.js version management +- **Docker** and Docker Compose (optional, Linux) -## Requirements - -* Zsh -* [Ag](https://github.com/ggreer/the_silver_searcher) -* [ITerm 2 (Mac)](https://www.iterm2.com/index.html) -* MVim (Mac) or GVim (Linux) -* [Gruvbox](https://github.com/morhetz/gruvbox) -* Tmux - -## Pre-Requirements +## Pre-requisites - curl -Ubuntu +On Ubuntu, if not already installed: -- `sudo apt-get install -y curl` +```bash +sudo apt-get install -y curl +``` ## Install -Run follow command: - +```bash +bash -c "$(curl -fSs https://raw.githubusercontent.com/campuscode/cc_dotfiles/master/install.sh)" ``` -sh -c "`curl -fSs https://raw.githubusercontent.com/campuscode/cc_dotfiles/master/install.sh`" + +You will be prompted for your password to change the default shell to zsh. + +For local development installs (from a cloned repo): + +```bash +LOCAL_INSTALL=1 bash install.sh ``` -Type your password to change your default shell to `zsh` +## Customization -## Docs +Every config file sources a `.local` counterpart if present. Place your personal overrides in these files rather than modifying the repo directly: + +| File | Purpose | +|---|---| +| `~/.aliases.local` | Custom shell aliases | +| `~/.zshrc.local` | Zsh configuration overrides | +| `~/.zshenv.local` | Environment variables | +| `~/.vimrc.local` | Vim settings and colorscheme | +| `~/.plugins.vim.local` | Additional vim plugins | +| `~/.tmux.conf.local` | Tmux configuration overrides | +| `~/.gitconfig.local` | Git user name, email, and overrides | +| `~/.secrets` | API keys and tokens (not tracked by git) | -[Vim Key Mapping](Vim.md) +## Key conventions -[Tmux Key Mapping](Tmux.md) +- **Vim leader**: `` +- **Tmux prefix**: `C-a` +- **Zsh vi mode**: `jj` to escape +- **Colorscheme**: gruvbox (dark) + +## Docs -#### It's easy to make your customization +- [Vim Key Mapping](Vim.md) +- [Tmux Key Mapping](Tmux.md) +- [Testing](tests/README.md) -Place your customization in the following files: +## Options -* .aliases.local -* .secrets -* .zshrc.local -* .vimrc.local -* .zshenv.local -* .plugin.vim.local -* .tmux.conf.local -* .gitconfig.local +- `SKIP_DOCKER=1` — skip Docker installation on Linux From 0850b9cd03e495d4ed04e379ca9c47347ec564c4 Mon Sep 17 00:00:00 2001 From: "Alan Rafael R. Batista" Date: Sat, 21 Mar 2026 21:42:19 -0300 Subject: [PATCH 22/29] Rewrite Vim.md and Tmux.md with complete key mapping reference Replace sparse lists with organized tables covering all custom key mappings. Add sections for navigation, search, copy mode, pane management, and status bar description. --- Tmux.md | 81 ++++++++++++++++++++++++++++++++------ Vim.md | 120 +++++++++++++++++++++++++++++++++++++++++--------------- 2 files changed, 157 insertions(+), 44 deletions(-) diff --git a/Tmux.md b/Tmux.md index 0baa10d..73456ab 100644 --- a/Tmux.md +++ b/Tmux.md @@ -1,21 +1,76 @@ -## Tmux +# Tmux Key Mappings -### Prefix +Prefix key is `C-a` (Ctrl+a). - - Ctrl-a +## Sessions -### Navigation +| Key | Action | +|---|---| +| `C-a d` | Detach from current session | +| `C-a C-a` | Switch to last active window | - - Vim navigation style with Ctrl-h j k l +## Windows -### Splits +| Key | Action | +|---|---| +| `C-a c` | Create new window (in current directory) | +| `C-a r` | Reload tmux configuration | - - Ctrl-a v opens a vertical split - - Ctrl-a s opens a horizontal split - - Ctrl-z toggles zoom out/in on the current split +## Panes -## Global +### Creating panes - - Ctrl-d detaches current split - - Ctrl-e synchronizes all splits - - Ctrl-E turn off splits synchronization +| Key | Action | +|---|---| +| `C-a v` | Vertical split (side by side) | +| `C-a s` | Horizontal split (top and bottom) | + +### Navigating panes + +Pane navigation is shared with vim — works seamlessly across vim splits and tmux panes. + +| Key | Action | +|---|---| +| `C-h` | Move to left pane | +| `C-j` | Move to pane below | +| `C-k` | Move to pane above | +| `C-l` | Move to right pane | + +### Resizing panes + +| Key | Action | +|---|---| +| `Shift-Left/Right` | Resize horizontally (small step) | +| `Shift-Up/Down` | Resize vertically (small step) | +| `C-Left/Right` | Resize horizontally (large step) | +| `C-Up/Down` | Resize vertically (large step) | +| `C-z` | Toggle zoom on current pane | + +## Synchronization + +Send the same input to all panes in a window — useful for running the same command on multiple servers. + +| Key | Action | +|---|---| +| `C-a e` | Enable pane synchronization | +| `C-a E` | Disable pane synchronization | + +## Copy Mode + +Enter copy mode with `C-a C-[`. Uses vi keybindings. + +| Key | Action | +|---|---| +| `v` | Begin selection | +| `C-v` | Toggle rectangle selection | +| `y` | Copy selection to clipboard | +| `Enter` | Copy selection to clipboard | + +## Status Bar + +The status bar shows: +- Current session name and user (left) +- Window list (center) +- Battery status, hostname, and date/time (right) + +Windows are automatically renamed to the current directory. diff --git a/Vim.md b/Vim.md index 6c0af61..d2304dd 100644 --- a/Vim.md +++ b/Vim.md @@ -1,31 +1,89 @@ -## Vim Key Mappings - -- Rspec + Tmux + Rubocop - - \rs - Run rspec - - \ra - Run rspec spec (all files) - - \rn - Run rspec spec (nearest spec) - - \rl - Run last spec - - \ru - Run full rubocop - -- Ctrl-P Fuzzy Finder - - \t or \p - - \b search only on buffer - -- NERDTree - - Ctrl+\\ open and close NERDTree - -- Vim-tmux-runner - - When open vim, it asks you which pane to attach - -- Ag - - K - search current word - -- Global - - vv - opens vertical split - - ss - opens horizontal split - - // - clear current search highlight - - Shift-t - Opens a new tab - - gt - Go to next tab - - Tab - In insert mode, start completion - - \vr - reload vim configuration - - \hl - toggle search highlighting on/off +# Vim Key Mappings + +Leader key is ``. + +## Navigation + +| Key | Action | +|---|---| +| `` | Switch between the last two files | +| `C-h` `C-j` `C-k` `C-l` | Navigate between vim/tmux panes seamlessly | +| `vv` | Open vertical split | +| `ss` | Open horizontal split | +| `-` | Zoom current pane (maximize) | +| `=` | Re-balance all panes | + +## File Explorer (NERDTree) + +| Key | Action | +|---|---| +| `C-\` | Toggle NERDTree / reveal current file | + +## Fuzzy Finder (CtrlP) + +| Key | Action | +|---|---| +| `t` | Open CtrlP file finder | +| `b` | Search open buffers | +| `m` | Search most recently used files | + +## Search + +| Key | Action | +|---|---| +| `K` | Search current word with Ag (Silver Searcher) | +| `//` | Clear current search highlight | +| `hl` | Toggle search highlighting on/off | + +## RSpec (via tmux runner) + +| Key | Action | +|---|---| +| `rs` | Run current spec file | +| `rn` | Run nearest spec | +| `rl` | Run last spec | +| `ra` | Run all specs | + +## Code Quality (via tmux runner) + +| Key | Action | +|---|---| +| `ru` | Run Rubocop on project | +| `rfu` | Run Rubocop on current file | +| `fl` | Run Flog on current file | + +## ERB Templates + +| Key | Mode | Action | +|---|---|---| +| `C-k` | Insert | Insert `<%= %>` tag | +| `C-j` | Insert | Insert `<% %>` tag | + +## Clipboard + +| Key | Action | +|---|---| +| `y` + motion | Copy to system clipboard (e.g., `yw` copies a word) | +| `p` | Paste from system clipboard | + +## Tabs + +| Key | Action | +|---|---| +| `Shift-t` | Open new tab | +| `Shift-Tab` | Go to next tab | + +## Completion + +| Key | Mode | Action | +|---|---|---| +| `Tab` | Insert | Autocomplete (or insert tab at beginning of line) | +| `Shift-Tab` | Insert | Next completion | + +## Other + +| Key | Action | +|---|---| +| `vr` | Reload vim configuration | +| `ct` | Generate ctags for the project | +| `gs` | Open Git status (fugitive) | From 7783115e68681c0c43ca24bb25f61abb43f5dd77 Mon Sep 17 00:00:00 2001 From: "Alan Rafael R. Batista" Date: Sat, 21 Mar 2026 22:01:42 -0300 Subject: [PATCH 23/29] Add GitHub Actions CI to test installation on Ubuntu and macOS Workflow tests the full install.sh on both platforms, then verifies mise, symlinks, and vim-plug are set up correctly. Skip chsh in Rakefile and Gogh in ubuntu.sh when CI=true (both require interactive input). --- .github/workflows/test-install.yml | 50 ++++++++++++++++++++++++++++++ Rakefile | 1 + ubuntu.sh | 5 ++- 3 files changed, 55 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/test-install.yml diff --git a/.github/workflows/test-install.yml b/.github/workflows/test-install.yml new file mode 100644 index 0000000..66725f9 --- /dev/null +++ b/.github/workflows/test-install.yml @@ -0,0 +1,50 @@ +name: Test Install + +on: + push: + branches: [master, main] + pull_request: + branches: [master, main] + +jobs: + ubuntu: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Install dotfiles + run: CI=true LOCAL_INSTALL=1 bash install.sh + - name: Verify mise + run: | + eval "$(~/.local/bin/mise activate bash)" + mise current ruby + mise current node + - name: Verify symlinks + run: | + test -L ~/.aliases + test -L ~/.zshrc + test -L ~/.vimrc + test -L ~/.tmux.conf + test -L ~/.gitconfig + - name: Verify vim-plug + run: test -f ~/.vim/autoload/plug.vim + + macos: + runs-on: macos-latest + steps: + - uses: actions/checkout@v4 + - name: Install dotfiles + run: CI=true LOCAL_INSTALL=1 bash install.sh + - name: Verify mise + run: | + eval "$(~/.local/bin/mise activate bash)" + mise current ruby + mise current node + - name: Verify symlinks + run: | + test -L ~/.aliases + test -L ~/.zshrc + test -L ~/.vimrc + test -L ~/.tmux.conf + test -L ~/.gitconfig + - name: Verify vim-plug + run: test -f ~/.vim/autoload/plug.vim diff --git a/Rakefile b/Rakefile index 79570fb..7f6e4f1 100644 --- a/Rakefile +++ b/Rakefile @@ -39,6 +39,7 @@ def install_vim_plugins end def change_shell + return if ENV['CI'] puts "You will change your default shell to zsh" run_command %{ chsh -s $(which zsh) } end diff --git a/ubuntu.sh b/ubuntu.sh index 0b4e4ec..f15cf1b 100755 --- a/ubuntu.sh +++ b/ubuntu.sh @@ -39,7 +39,10 @@ install_docker() { } install_tmux -install_gnome_terminal_colors + +if [ -z "${CI:-}" ]; then + install_gnome_terminal_colors +fi if [ "${SKIP_DOCKER:-}" != "1" ]; then install_docker From e58d05de1ff8fc4e3bebff073f277c311c6ddf37 Mon Sep 17 00:00:00 2001 From: "Alan Rafael R. Batista" Date: Sat, 21 Mar 2026 22:12:43 -0300 Subject: [PATCH 24/29] Increase mise HTTP timeout in CI to 120s Node.js download from nodejs.org timed out at the default 30s. --- .github/workflows/test-install.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test-install.yml b/.github/workflows/test-install.yml index 66725f9..d50d412 100644 --- a/.github/workflows/test-install.yml +++ b/.github/workflows/test-install.yml @@ -12,7 +12,7 @@ jobs: steps: - uses: actions/checkout@v4 - name: Install dotfiles - run: CI=true LOCAL_INSTALL=1 bash install.sh + run: CI=true LOCAL_INSTALL=1 MISE_HTTP_TIMEOUT=120 bash install.sh - name: Verify mise run: | eval "$(~/.local/bin/mise activate bash)" @@ -33,7 +33,7 @@ jobs: steps: - uses: actions/checkout@v4 - name: Install dotfiles - run: CI=true LOCAL_INSTALL=1 bash install.sh + run: CI=true LOCAL_INSTALL=1 MISE_HTTP_TIMEOUT=120 bash install.sh - name: Verify mise run: | eval "$(~/.local/bin/mise activate bash)" From 21f4a1e57227db5f53c92b3962f599d5a65a7e69 Mon Sep 17 00:00:00 2001 From: "Alan Rafael R. Batista" Date: Sat, 21 Mar 2026 22:19:02 -0300 Subject: [PATCH 25/29] Install Ruby and Node sequentially to avoid download timeout mise installs tools in parallel by default. On CI, the Node download was timing out while waiting for Ruby to compile. Installing sequentially avoids the issue. --- install.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/install.sh b/install.sh index 5ff15b1..2cf4608 100755 --- a/install.sh +++ b/install.sh @@ -40,13 +40,15 @@ case "$(uname -s)" in curl https://mise.run | sh eval "$(~/.local/bin/mise activate bash)" mise settings ruby.compile=false - mise use --global ruby node + mise use --global ruby + mise use --global node ;; Darwin) curl https://mise.run | sh eval "$(~/.local/bin/mise activate bash)" mise settings ruby.compile=false - mise use --global ruby node + mise use --global ruby + mise use --global node ;; *) echo "Operational system not supported, aborting installation" From 337aa3b3b4d603d761fd15612d262ef46114d3d6 Mon Sep 17 00:00:00 2001 From: "Alan Rafael R. Batista" Date: Sat, 21 Mar 2026 22:40:01 -0300 Subject: [PATCH 26/29] Call mac.sh before mise to install Ruby build dependencies mac.sh now runs before mise in install.sh so Homebrew and build dependencies (openssl, libyaml, readline) are available for Ruby compilation. Made Homebrew installation idempotent. --- install.sh | 2 ++ mac.sh | 8 ++++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/install.sh b/install.sh index 2cf4608..49727ee 100755 --- a/install.sh +++ b/install.sh @@ -44,6 +44,8 @@ case "$(uname -s)" in mise use --global node ;; Darwin) + bash "$(dirname "$0")/mac.sh" + curl https://mise.run | sh eval "$(~/.local/bin/mise activate bash)" mise settings ruby.compile=false diff --git a/mac.sh b/mac.sh index 328e0f9..ef6f648 100755 --- a/mac.sh +++ b/mac.sh @@ -1,6 +1,10 @@ #!/bin/bash set -eu -/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" -brew install zsh ctags git gh tmux the_silver_searcher macvim +if ! command -v brew > /dev/null 2>&1; then + /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" + eval "$(/opt/homebrew/bin/brew shellenv 2>/dev/null || /usr/local/bin/brew shellenv)" +fi + +brew install openssl@3 libyaml readline zsh ctags git gh tmux the_silver_searcher macvim brew install --cask visual-studio-code google-chrome iterm2 From fd9e93f34796b65c3e17afd794e99dfc909e6260 Mon Sep 17 00:00:00 2001 From: "Alan Rafael R. Batista" Date: Sat, 21 Mar 2026 23:33:58 -0300 Subject: [PATCH 27/29] Load brew shellenv after mac.sh so mise finds Homebrew dependencies The mac.sh runs in a subshell (bash), so its environment changes don't propagate. Explicitly eval brew shellenv after mac.sh so libyaml and openssl are visible to ruby-build via mise. --- install.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/install.sh b/install.sh index 49727ee..c71b40a 100755 --- a/install.sh +++ b/install.sh @@ -45,6 +45,7 @@ case "$(uname -s)" in ;; Darwin) bash "$(dirname "$0")/mac.sh" + eval "$(/opt/homebrew/bin/brew shellenv 2>/dev/null || /usr/local/bin/brew shellenv)" curl https://mise.run | sh eval "$(~/.local/bin/mise activate bash)" From e57779ff7232e72d02ec51b8e07673ffef3f99dd Mon Sep 17 00:00:00 2001 From: "Alan Rafael R. Batista" Date: Sat, 21 Mar 2026 23:39:40 -0300 Subject: [PATCH 28/29] Add OrbStack to mac.sh for Docker and Docker Compose on macOS --- mac.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mac.sh b/mac.sh index ef6f648..62a100e 100755 --- a/mac.sh +++ b/mac.sh @@ -7,4 +7,4 @@ if ! command -v brew > /dev/null 2>&1; then fi brew install openssl@3 libyaml readline zsh ctags git gh tmux the_silver_searcher macvim -brew install --cask visual-studio-code google-chrome iterm2 +brew install --cask visual-studio-code google-chrome iterm2 orbstack From dc2427bdd8e11890a66d7261b570e6b5da0e0917 Mon Sep 17 00:00:00 2001 From: "Alan Rafael R. Batista" Date: Sat, 21 Mar 2026 23:41:16 -0300 Subject: [PATCH 29/29] Update README to mention OrbStack for Docker on macOS --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 80f731c..629b026 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ Inspired by [Skwp Dotfiles](https://github.com/skwp/dotfiles) and [ThoughtBot Do - **Tmux** with `C-a` prefix, vim-aware pane navigation, battery status, and vi copy mode - **Git** with aliases, patience diff, vimdiff merge tool, and rerere enabled - **mise** for Ruby and Node.js version management -- **Docker** and Docker Compose (optional, Linux) +- **Docker** and Docker Compose via [OrbStack](https://orbstack.dev) (macOS) or Docker CE (Linux, optional) ## Pre-requisites