Skip to content

Commit 1af5589

Browse files
authored
Merge pull request #23 from campuscode/modernize-test-infrastructure
Modernize dotfiles infrastructure and update deprecated tools
2 parents dc38ab0 + dc2427b commit 1af5589

29 files changed

+613
-1281
lines changed

.github/workflows/test-install.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: Test Install
2+
3+
on:
4+
push:
5+
branches: [master, main]
6+
pull_request:
7+
branches: [master, main]
8+
9+
jobs:
10+
ubuntu:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v4
14+
- name: Install dotfiles
15+
run: CI=true LOCAL_INSTALL=1 MISE_HTTP_TIMEOUT=120 bash install.sh
16+
- name: Verify mise
17+
run: |
18+
eval "$(~/.local/bin/mise activate bash)"
19+
mise current ruby
20+
mise current node
21+
- name: Verify symlinks
22+
run: |
23+
test -L ~/.aliases
24+
test -L ~/.zshrc
25+
test -L ~/.vimrc
26+
test -L ~/.tmux.conf
27+
test -L ~/.gitconfig
28+
- name: Verify vim-plug
29+
run: test -f ~/.vim/autoload/plug.vim
30+
31+
macos:
32+
runs-on: macos-latest
33+
steps:
34+
- uses: actions/checkout@v4
35+
- name: Install dotfiles
36+
run: CI=true LOCAL_INSTALL=1 MISE_HTTP_TIMEOUT=120 bash install.sh
37+
- name: Verify mise
38+
run: |
39+
eval "$(~/.local/bin/mise activate bash)"
40+
mise current ruby
41+
mise current node
42+
- name: Verify symlinks
43+
run: |
44+
test -L ~/.aliases
45+
test -L ~/.zshrc
46+
test -L ~/.vimrc
47+
test -L ~/.tmux.conf
48+
test -L ~/.gitconfig
49+
- name: Verify vim-plug
50+
run: test -f ~/.vim/autoload/plug.vim

CLAUDE.md

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# CLAUDE.md
2+
3+
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
4+
5+
## Overview
6+
7+
This is **Campus Code Dotfiles (cc_dotfiles)** — a shared dotfiles distribution for zsh, vim, tmux, and git, targeting macOS and Ubuntu.
8+
9+
## Installation
10+
11+
```bash
12+
# Remote install (clones to ~/.cc_dotfiles, then runs rake install)
13+
bash -c "$(curl -fSs https://raw.githubusercontent.com/campuscode/cc_dotfiles/master/install.sh)"
14+
15+
# Local install (from a cloned repo)
16+
LOCAL_INSTALL=1 bash install.sh
17+
```
18+
19+
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.
20+
21+
## Testing
22+
23+
Tests run in isolated VMs to avoid affecting the host machine:
24+
- **macOS**: Vagrant + UTM plugin with Ubuntu 24.04 Desktop (`vagrant up --provider=utm`)
25+
- **Linux**: Multipass with Ubuntu 24.04 (`./tests/test_linux.sh`)
26+
27+
See [tests/README.md](tests/README.md) for detailed setup instructions.
28+
29+
## Architecture
30+
31+
**install.sh** is the entry point — installs system packages, mise, Ruby, and Node.js, then copies the repo and runs `rake install`.
32+
33+
**Rakefile** is the installer — symlinks files, runs `mac.sh` or `ubuntu.sh` for platform-specific prerequisites, and sets up plugins.
34+
35+
**mac.sh / ubuntu.sh** install platform-specific dependencies (Homebrew packages on macOS, Docker/tmux/Gogh on Ubuntu).
36+
37+
**Customization layer**: Every config file sources a `.local` counterpart if present. Users put personal overrides in `.local` files rather than modifying the repo.
38+
39+
**Key conventions**:
40+
- Vim leader key is `<Space>`
41+
- Tmux prefix is `C-a` (not the default `C-b`)
42+
- Zsh uses vi mode with `jj` bound to escape
43+
- Default colorscheme is gruvbox (dark background)
44+
- Vim plugin manager is [vim-plug](https://github.com/junegunn/vim-plug) (`~/.vim/plugins.vim`)
45+
- Vim settings are auto-loaded from `vim/settings/*.vim`
46+
- Zsh functions are auto-loaded from `zsh/functions/*`
47+
- Zsh theme is `peepcode` (`zsh/themes/peepcode.theme`)
48+
- Ruby and Node.js managed by [mise](https://mise.jdx.dev)
49+
50+
**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`).
51+
52+
**Git config** (`git/gitconfig`): patience diff algorithm, vimdiff as merge tool, rerere enabled, push default is `simple`. Local overrides via `~/.gitconfig.local`.

README.md

Lines changed: 49 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,58 +1,72 @@
1-
CAMPUS CODE Dotfiles
2-
====================
1+
# Campus Code Dotfiles
32

43
![](https://i.imgur.com/XogkB7V.png)
54

6-
## Source of inspiration
5+
A shared dotfiles distribution for **zsh**, **vim**, **tmux**, and **git**, targeting macOS and Ubuntu.
76

8-
Our dotfiles are based on following amazing dotfiles:
7+
Inspired by [Skwp Dotfiles](https://github.com/skwp/dotfiles) and [ThoughtBot Dotfiles](https://github.com/thoughtbot/dotfiles).
98

10-
[Skwp Dotfiles](http://github.com/skwp/dotfiles)
9+
## What's included
1110

12-
[ThoughtBot Dotfiles](http://github.com/thoughtbot/dotfiles)
11+
- **Zsh** with vi mode, custom theme (peepcode), syntax highlighting, and extensive aliases
12+
- **Vim** with vim-plug, gruvbox colorscheme, ALE linting, NERDTree, CtrlP, and tmux integration
13+
- **Tmux** with `C-a` prefix, vim-aware pane navigation, battery status, and vi copy mode
14+
- **Git** with aliases, patience diff, vimdiff merge tool, and rerere enabled
15+
- **mise** for Ruby and Node.js version management
16+
- **Docker** and Docker Compose via [OrbStack](https://orbstack.dev) (macOS) or Docker CE (Linux, optional)
1317

14-
## Requirements
15-
16-
* Zsh
17-
* [Ag](https://github.com/ggreer/the_silver_searcher)
18-
* [ITerm 2 (Mac)](https://www.iterm2.com/index.html)
19-
* MVim (Mac) or GVim (Linux)
20-
* [Gruvbox](https://github.com/morhetz/gruvbox)
21-
* Tmux
22-
23-
## Pre-Requirements
18+
## Pre-requisites
2419

2520
- curl
2621

27-
Ubuntu
22+
On Ubuntu, if not already installed:
2823

29-
- `sudo apt-get install -y curl`
24+
```bash
25+
sudo apt-get install -y curl
26+
```
3027

3128
## Install
3229

33-
Run follow command:
34-
30+
```bash
31+
bash -c "$(curl -fSs https://raw.githubusercontent.com/campuscode/cc_dotfiles/master/install.sh)"
3532
```
36-
sh -c "`curl -fSs https://raw.githubusercontent.com/campuscode/cc_dotfiles/master/install.sh`"
33+
34+
You will be prompted for your password to change the default shell to zsh.
35+
36+
For local development installs (from a cloned repo):
37+
38+
```bash
39+
LOCAL_INSTALL=1 bash install.sh
3740
```
3841

39-
Type your password to change your default shell to `zsh`
42+
## Customization
4043

41-
## Docs
44+
Every config file sources a `.local` counterpart if present. Place your personal overrides in these files rather than modifying the repo directly:
45+
46+
| File | Purpose |
47+
|---|---|
48+
| `~/.aliases.local` | Custom shell aliases |
49+
| `~/.zshrc.local` | Zsh configuration overrides |
50+
| `~/.zshenv.local` | Environment variables |
51+
| `~/.vimrc.local` | Vim settings and colorscheme |
52+
| `~/.plugins.vim.local` | Additional vim plugins |
53+
| `~/.tmux.conf.local` | Tmux configuration overrides |
54+
| `~/.gitconfig.local` | Git user name, email, and overrides |
55+
| `~/.secrets` | API keys and tokens (not tracked by git) |
4256

43-
[Vim Key Mapping](Vim.md)
57+
## Key conventions
4458

45-
[Tmux Key Mapping](Tmux.md)
59+
- **Vim leader**: `<Space>`
60+
- **Tmux prefix**: `C-a`
61+
- **Zsh vi mode**: `jj` to escape
62+
- **Colorscheme**: gruvbox (dark)
63+
64+
## Docs
4665

47-
#### It's easy to make your customization
66+
- [Vim Key Mapping](Vim.md)
67+
- [Tmux Key Mapping](Tmux.md)
68+
- [Testing](tests/README.md)
4869

49-
Place your customization in the following files:
70+
## Options
5071

51-
* .aliases.local
52-
* .secrets
53-
* .zshrc.local
54-
* .vimrc.local
55-
* .zshenv.local
56-
* .plugin.vim.local
57-
* .tmux.conf.local
58-
* .gitconfig.local
72+
- `SKIP_DOCKER=1` — skip Docker installation on Linux

Rakefile

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ def install_vim_plugins
3939
end
4040

4141
def change_shell
42+
return if ENV['CI']
4243
puts "You will change your default shell to zsh"
4344
run_command %{ chsh -s $(which zsh) }
4445
end
@@ -109,9 +110,6 @@ end
109110
def linux_message
110111
puts ''
111112
puts "- Change your terminal window to Run command as login shell and RESTART"
112-
puts ''
113-
puts "- You can find more information about this on \r
114-
https://github.com/rvm/ubuntu_rvm"
115113
end
116114

117115
def installation_message
@@ -121,7 +119,7 @@ def installation_message
121119
puts 'Thank you!'
122120
puts ''
123121
puts ''
124-
linux_message if linux?
122+
puts "- Run 'mise install ruby node' to install latest versions" if linux?
125123
puts '======================================================================='
126124
end
127125

Tmux.md

Lines changed: 68 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,76 @@
1-
## Tmux
1+
# Tmux Key Mappings
22

3-
### Prefix
3+
Prefix key is `C-a` (Ctrl+a).
44

5-
- Ctrl-a
5+
## Sessions
66

7-
### Navigation
7+
| Key | Action |
8+
|---|---|
9+
| `C-a d` | Detach from current session |
10+
| `C-a C-a` | Switch to last active window |
811

9-
- Vim navigation style with Ctrl-h j k l
12+
## Windows
1013

11-
### Splits
14+
| Key | Action |
15+
|---|---|
16+
| `C-a c` | Create new window (in current directory) |
17+
| `C-a r` | Reload tmux configuration |
1218

13-
- Ctrl-a v opens a vertical split
14-
- Ctrl-a s opens a horizontal split
15-
- Ctrl-z toggles zoom out/in on the current split
19+
## Panes
1620

17-
## Global
21+
### Creating panes
1822

19-
- Ctrl-d detaches current split
20-
- Ctrl-e synchronizes all splits
21-
- Ctrl-E turn off splits synchronization
23+
| Key | Action |
24+
|---|---|
25+
| `C-a v` | Vertical split (side by side) |
26+
| `C-a s` | Horizontal split (top and bottom) |
27+
28+
### Navigating panes
29+
30+
Pane navigation is shared with vim — works seamlessly across vim splits and tmux panes.
31+
32+
| Key | Action |
33+
|---|---|
34+
| `C-h` | Move to left pane |
35+
| `C-j` | Move to pane below |
36+
| `C-k` | Move to pane above |
37+
| `C-l` | Move to right pane |
38+
39+
### Resizing panes
40+
41+
| Key | Action |
42+
|---|---|
43+
| `Shift-Left/Right` | Resize horizontally (small step) |
44+
| `Shift-Up/Down` | Resize vertically (small step) |
45+
| `C-Left/Right` | Resize horizontally (large step) |
46+
| `C-Up/Down` | Resize vertically (large step) |
47+
| `C-z` | Toggle zoom on current pane |
48+
49+
## Synchronization
50+
51+
Send the same input to all panes in a window — useful for running the same command on multiple servers.
52+
53+
| Key | Action |
54+
|---|---|
55+
| `C-a e` | Enable pane synchronization |
56+
| `C-a E` | Disable pane synchronization |
57+
58+
## Copy Mode
59+
60+
Enter copy mode with `C-a C-[`. Uses vi keybindings.
61+
62+
| Key | Action |
63+
|---|---|
64+
| `v` | Begin selection |
65+
| `C-v` | Toggle rectangle selection |
66+
| `y` | Copy selection to clipboard |
67+
| `Enter` | Copy selection to clipboard |
68+
69+
## Status Bar
70+
71+
The status bar shows:
72+
- Current session name and user (left)
73+
- Window list (center)
74+
- Battery status, hostname, and date/time (right)
75+
76+
Windows are automatically renamed to the current directory.

Vagrantfile

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,18 @@
11
# -*- mode: ruby -*-
22
# vi: set ft=ruby :
33

4-
Vagrant.configure(2) do |config|
5-
config.vm.box = "ubuntu/focal64"
4+
Vagrant.configure("2") do |config|
5+
config.vm.box = "bento/ubuntu-24.04"
66

7-
config.vm.synced_folder ".", "/vagrant", id: "vagrant-root"
8-
config.vm.synced_folder "~/workspace", "/workspace", id: "vagrant-repos"
7+
config.vm.provider :utm do |utm|
8+
utm.name = "cc-dotfiles"
9+
utm.memory = 4096
10+
utm.cpus = 2
11+
utm.directory_share_mode = "virtFS"
12+
utm.notes = "Campus Code Dotfiles testing VM"
13+
end
914

10-
config.vm.network :private_network, ip: "192.168.10.10"
15+
config.vm.synced_folder ".", "/vagrant"
16+
17+
config.vm.provision "shell", inline: "apt-get update && apt-get install -y curl"
1118
end

0 commit comments

Comments
 (0)