Skip to content

Latest commit

 

History

History
237 lines (169 loc) · 6.74 KB

File metadata and controls

237 lines (169 loc) · 6.74 KB

profile image of running refrigerator

Dotfiles

Configuration files for my development environment.

GitHub License

Supported Platforms

Family Distros Package manager
Arch Arch, Manjaro, EndeavourOS pacman
RHEL Rocky, Alma, Fedora, RHEL, CentOS Stream dnf + EPEL
Debian Debian, Ubuntu, Mint, Pop!_OS apt
macOS macOS brew
Windows Windows 10/11 winget (via bootstrap.ps1)

Prerequisites

The bootstrap script will attempt to install missing prerequisites automatically.

Quick Start

git clone https://github.com/hwhang0917/dotfiles.git ~/dotfiles
cd ~/dotfiles
./bootstrap.sh

The bootstrap script will:

  1. Check for required dependencies (git, stow, curl)

  2. Detect your platform (linux, wsl, macos, windows)

  3. Install gum for interactive prompts (falls back to basic read if unavailable)

  4. Initialize git submodules

  5. Interactively select optional tools to install:

    Tool Description Install method
    fzf Fuzzy finder pacman / apt / brew
    zoxide Smarter cd pacman / brew / install script
    eza Modern ls pacman / brew / cargo
    bat Modern cat pacman / apt / brew
    starship Prompt pacman / brew / install script
    fnm Fast Node Manager pacman / brew / install script
  6. Interactively select stow packages (platform defaults pre-selected)

  7. Remind to set up git local configuration if missing

  8. Register the claude-model clean filter

Platform packages

Platform Stow packages
Common (all) git, zsh, tmux, nvim, vim, scripts, tig, yazi
Linux hypr, sway, ghostty, kime
WSL (common only)
macOS ghostty
Windows (use bootstrap.ps1)

Manual Installation

Linux / macOS / WSL

  1. Clone the repository:

    git clone https://github.com/hwhang0917/dotfiles.git ~/dotfiles
  2. Initialize submodules:

    cd ~/dotfiles
    git submodule update --init --recursive
  3. Stow packages:

    stow <package>

Windows

Windows does not support GNU Stow. Use bootstrap.ps1 instead (requires Administrator):

# Run PowerShell as Administrator
git clone https://github.com/hwhang0917/dotfiles.git $HOME\dotfiles
cd $HOME\dotfiles
.\bootstrap.ps1

The script will install tools via winget (Git, Neovim, AutoHotkey, GlazeWM, Zebar, fnm, fzf, Starship), install Node.js LTS via fnm, initialize submodules, build the Zebar widget, create symlinks, and set up git local config.

Create-Symlink.ps1

windows/scripts/Create-Symlink.ps1 is a lightweight alternative to GNU Stow for Windows. It creates symbolic links and requires Administrator privileges.

.\windows\scripts\Create-Symlink.ps1 <target> <symlink>

If <symlink> is a directory, the symlink is created inside it using the target's filename.

# Create symlink at an explicit path
.\windows\scripts\Create-Symlink.ps1 .\windows\scripts\Create-Symlink.ps1 C:\bin\Create-Symlink.ps1

# Create symlink inside a directory (C:\bin\Create-Symlink.ps1)
.\windows\scripts\Create-Symlink.ps1 .\windows\scripts\Create-Symlink.ps1 C:\bin\
  • Errors early if not running as Administrator
  • Skips if an identical symlink already exists
  • Prompts before replacing a symlink that points to a different target
  • Creates parent directories as needed

Neovim

See nvim/.config/nvim/README.md for setup, requirements, and local configuration.

Git Configuration

After stowing git (or running bootstrap.ps1), set up your local credentials:

cp ~/dotfiles/git/.gitconfig.local.example ~/.gitconfig.local

Edit ~/.gitconfig.local with your name, email, and signing key:

[credential "https://github.com"]
    helper =
    helper = !/usr/bin/gh auth git-credential
[credential "https://gist.github.com"]
    helper =
    helper = !/usr/bin/gh auth git-credential
[user]
    name = Your Name
    email = your.email@example.com
    signingKey = ~/.ssh/id_ed25519.pub

Optionally add includeIf for work-specific configs:

[includeIf "gitdir:~/work/"]
    path = ~/work/.gitconfig

claude-model git filter

claude/.claude/settings.json is tracked, but Claude Code's /model command rewrites its model field on every switch. To keep the file committable while ignoring those local model changes, a git clean filter (declared in .gitattributes) normalizes the model line to a canonical value whenever git reads the file — your working copy keeps whatever model you set, but git never sees the difference. Real edits (plugins, hooks, effortLevel) still show and commit normally.

Git filters live in .git/config, which is not cloned, so the filter must be registered per machine. bootstrap.sh does this automatically; to set it up manually:

git config filter.claude-model.clean \
  'sed -E '\''s/^([[:space:]]*"model"[[:space:]]*:[[:space:]]*")[^"]*(".*)$/\1opus[1m]\2/'\'''
git config filter.claude-model.smudge cat

Until it's registered, git falls back to committing the literal model line (no error, just no filtering).

Uninstallation

To uninstall a package, you can use GNU Stow with the -D option:

stow -D <package>

Troubleshooting

Stow conflicts with existing files

If stow fails due to existing files:

stow -D <package>  # Remove any partial stow
mv ~/.config/<file> ~/.config/<file>.backup  # Backup existing file
stow <package>  # Try again

Submodule issues

If submodules fail to initialize:

git submodule sync
git submodule update --init --recursive --force

Missing optional tool warnings

The bootstrap script can install these automatically. To re-run just the install step:

./bootstrap.sh

Or install manually — see the optional tools table above for links.

Bootstrap fails with "Missing required dependencies"

Install the prerequisites first:

# Debian/Ubuntu
sudo apt install git stow curl

# Arch
sudo pacman -S git stow curl

# macOS
brew install git stow curl