cmc/dotfiles

Using GNU Stow to manage my dotfiles. config dotfiles macos stow

Commit af4b92b972

af4b92b972bfcb8bd67d8132c953e6fbb1d02296

parent: ab794ba436

Unsigned

cmc <hello@cleberg.net> · 2026-02-08 17:52 UTC

format ZSH and update Git

Layout: unified · split

bootstrap.sh +32 −10
@@ -2,34 +2,56 @@
22
33# Define colors for output
44GREEN='\033[0;32m'
5BLUE='\033[0;34m'
56RED='\033[0;31m'
67NC='\033[0m' # No Color
78
8echo "Starting dotfiles bootstrap..."
9echo -e "${BLUE} Starting dotfiles bootstrap...${NC}"
910
10# 1. Check if GNU Stow is installed
11if ! command -v stow &> /dev/null; then
12 echo -e "${RED}Error: GNU Stow is not installed.${NC}"
13 echo "Please install it via your package manager (brew install stow / apt install stow)."
14 exit 1
11# 1. Check for Homebrew
12if ! command -v brew &> /dev/null; then
13 echo "Installing Homebrew..."
14 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
15else
16 echo -e "${GREEN}✓ Homebrew is already installed${NC}"
1517fi
1618
17# 2. Get the directory where this script is located
19# 2. Install Dependencies
20echo "Checking dependencies..."
21DEPENDENCIES=(
22 stow
23 zsh-autosuggestions
24 zsh-syntax-highlighting
25 romkatv/powerlevel10k/powerlevel10k
26)
27
28for dep in "${DEPENDENCIES[@]}"; do
29 if brew list "$dep" &>/dev/null || brew list --cask "$dep" &>/dev/null; then
30 echo -e "${GREEN}✓ $dep is already installed${NC}"
31 else
32 echo "Installing $dep..."
33 brew install "$dep"
34 fi
35done
36
37# 3. Get the directory where this script is located
1838DOTFILES_DIR=$(dirname "$(realpath "$0")")
1939cd "$DOTFILES_DIR"
2040
21# 3. Define packages based on your folder structure
41# 4. Define packages based on your folder structure
2242PACKAGES=(doom git ispell skhd yabai zsh)
2343
24echo "Symlinking packages..."
44echo -e "${BLUE} Symlinking packages with GNU Stow...${NC}"
2545
2646for pkg in "${PACKAGES[@]}"; do
2747 if [ -d "$pkg" ]; then
2848 echo -e "Stowing: ${GREEN}$pkg${NC}"
49 # -R (restow) is safer as it prunes dead links and updates new ones
2950 stow -R "$pkg"
3051 else
3152 echo -e "${RED}Warning: Package directory '$pkg' not found. Skipping.${NC}"
3253 fi
3354done
3455
35echo -e "${GREEN}Done! Your dotfiles are now stowed.${NC}"
56echo -e "${GREEN} Done! Your environment is ready.${NC}"
57echo "Note: You may need to restart your terminal or run 'source ~/.zshrc'"
git/.gitconfig +1
@@ -4,6 +4,7 @@
44 email = hello@cleberg.net
55 signingkey = hello@cleberg.net
66[core]
7 excludesfile = ~/.gitignore_global
78 editor = emacs
89 autocrlf = input
910 untrackedCache = true
git/.gitignore_global added +29
@@ -0,0 +1,29 @@
1# macOS
2.DS_Store
3.AppleDouble
4.LSOverride
5
6# Thumbnails
7._*
8
9# Files that might appear in the root of a volume
10.DocumentRevisions-V100
11.fseventsd
12.Spotlight-V100
13.TemporaryItems
14.Trashes
15.VolumeIcon.icns
16.com.apple.timemachine.donotpresent
17
18# Editors
19*.swp
20*.swo
21*~
22.vscode/
23.idea/
24
25# Common logs
26*.log
27npm-debug.log*
28yarn-debug.log*
29yarn-error.log*
zsh/.zshrc +66 −36
@@ -1,53 +1,83 @@
1echo 'export PATH=/Users/cmc/.local/xonsh-env/xbin:$PATH' >> ~/.zshrc
2
3# Enable Powerlevel10k instant prompt. Should stay close to the top of ~/.zshrc.
4# Initialization code that may require console input (password prompts, [y/n]
5# confirmations, etc.) must go above this block; everything else may go below.
1# ==============================================================================
2# 1. PRE-INITIALIZATION (Instant Prompt)
3# ==============================================================================
64if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then
75 source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh"
86fi
97
10export NVM_DIR="$HOME/.nvm"
11[ -s "/opt/homebrew/opt/nvm/nvm.sh" ] && \. "/opt/homebrew/opt/nvm/nvm.sh" # This loads nvm
12[ -s "/opt/homebrew/opt/nvm/etc/bash_completion.d/nvm" ] && \. "/opt/homebrew/opt/nvm/etc/bash_completion.d/nvm" # This loads nvm bash_completion
13
8# ==============================================================================
9# 2. ENVIRONMENT VARIABLES & PATH
10# ==============================================================================
11export PATH="/Users/cmc/.local/xonsh-env/xbin:$PATH"
1412export GPG_TTY=$(tty)
1513
16alias l="ls -lha"
17alias emacs="emacs -nw"
14# NVM Configuration
15export NVM_DIR="$HOME/.nvm"
16[ -s "/opt/homebrew/opt/nvm/nvm.sh" ] && \. "/opt/homebrew/opt/nvm/nvm.sh"
17[ -s "/opt/homebrew/opt/nvm/etc/bash_completion.d/nvm" ] && \. "/opt/homebrew/opt/nvm/etc/bash_completion.d/nvm"
1818
19# Lines configured by zsh-newuser-install
19# History Settings
2020HISTFILE=~/.histfile
2121HISTSIZE=1000
2222SAVEHIST=1000
23
24# ==============================================================================
25# 3. COMPLETION & UI SETTINGS
26# ==============================================================================
2327bindkey -e
24# End of lines configured by zsh-newuser-install
25# The following lines were added by compinstall
2628zstyle :compinstall filename '/Users/cmc/.zshrc'
29autoload -Uz compinit && compinit
2730
28autoload -Uz compinit
29compinit
30# End of lines added by compinstall
31# Load Theme
3132source /opt/homebrew/share/powerlevel10k/powerlevel10k.zsh-theme
32
33# To customize prompt, run `p10k configure` or edit ~/.p10k.zsh.
3433[[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh
3534
35# ==============================================================================
36# 4. ALIASES
37# ==============================================================================
38alias l="ls -lha"
39alias emacs="emacs -nw"
40alias xclean="find . -name '.DS_Store' -type f -delete"
41
42# Git
43alias g='git'
44alias gs='git status'
45alias ga='git add'
46alias gaa='git add --all'
47alias gc='git commit -v'
48alias gcm='git commit -m'
49alias gca='git commit --amend --no-edit'
50alias gb='git branch'
51alias gco='git checkout'
52alias gcob='git checkout -b'
53alias gma='git checkout main'
54
55# ==============================================================================
56# 5. PLUGINS (Must be loaded after aliases for best results)
57# ==============================================================================
3658source /opt/homebrew/share/zsh-autosuggestions/zsh-autosuggestions.zsh
37export PATH=/Users/cmc/.local/xonsh-env/xbin:$PATH
38export PATH=/Users/cmc/.local/xonsh-env/xbin:$PATH
39export PATH=/Users/cmc/.local/xonsh-env/xbin:$PATH
40export PATH=/Users/cmc/.local/xonsh-env/xbin:$PATH
41export PATH=/Users/cmc/.local/xonsh-env/xbin:$PATH
42export PATH=/Users/cmc/.local/xonsh-env/xbin:$PATH
43export PATH=/Users/cmc/.local/xonsh-env/xbin:$PATH
44export PATH=/Users/cmc/.local/xonsh-env/xbin:$PATH
45export PATH=/Users/cmc/.local/xonsh-env/xbin:$PATH
46export PATH=/Users/cmc/.local/xonsh-env/xbin:$PATH
47export PATH=/Users/cmc/.local/xonsh-env/xbin:$PATH
48export PATH=/Users/cmc/.local/xonsh-env/xbin:$PATH
49export PATH=/Users/cmc/.local/xonsh-env/xbin:$PATH
50export PATH=/Users/cmc/.local/xonsh-env/xbin:$PATH
51export PATH=/Users/cmc/.local/xonsh-env/xbin:$PATH
52export PATH=/Users/cmc/.local/xonsh-env/xbin:$PATH
53export PATH=/Users/cmc/.local/xonsh-env/xbin:$PATH
59
60# Syntax Highlighting MUST be the last thing sourced
61source /opt/homebrew/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
62
63# ==============================================================================
64# 6. SYNTAX HIGHLIGHTING CUSTOMIZATION
65# ==============================================================================
66# Must be defined AFTER the plugin is sourced
67# Colors available: black, red, green, yellow, blue, magenta, cyan, white
68# Styles: bold, underline
69
70# Highlight aliases in Cyan
71ZSH_HIGHLIGHT_STYLES[alias]='fg=cyan,bold'
72
73# Highlight standard commands in Green
74ZSH_HIGHLIGHT_STYLES[command]='fg=green'
75
76# Highlight built-ins (like cd, echo) in Magenta
77ZSH_HIGHLIGHT_STYLES[builtin]='fg=magenta'
78
79# Highlight valid paths in White with an underline
80ZSH_HIGHLIGHT_STYLES[path]='fg=white,underline'
81
82# Highlight errors (typos) in Red
83ZSH_HIGHLIGHT_STYLES[unknown-token]='fg=red,bold'