Skip to content

cuberhaus/WinDotfiles

Repository files navigation

Windows Windows 11 dotfiles

CI Secrets Winget Drift

Windows 11 dotfiles managed with Chezmoi. Includes editor configs, shell profiles, app settings, and automation scripts for a reproducible setup.

What's Included

Category Tools
Editors Vim, Neovim, Emacs (Chemacs2 + Doom), IntelliJ IdeaVim, Sublime Text, VS Code
Shell PowerShell 7+, Windows PowerShell 5.1, custom modules (git aliases, rclone, shortcuts, tools)
Terminal Windows Terminal (Sauce Code Pro NF)
Desktop Rainmeter (RSS feed), AutoHotkey (brightness keys), Auto Dark Mode (wallpaper switching)
Apps VLC, TeXstudio, RStudio, PowerToys
Git Global .gitignore_global (OS/IDE/build junk), LF line endings, autocrlf = input
Automation Chocolatey install scripts, bloatware removal, registry tweaks, WSL setup

Table of Contents

Installation

Tip: Run these commands from the Windows PowerShell app (run as Administrator), not from Windows Terminal.

Automated Setup (Recommended)

Download and run the setup script:

iwr -useb https://raw.githubusercontent.com/cuberhaus/WinDotfiles/master/setup-dotfiles.ps1 -OutFile setup-dotfiles.ps1
.\setup-dotfiles.ps1

The script auto-elevates to admin, installs Chocolatey + Git + chezmoi, applies the dotfiles, and then prompts for an install profile:

Profile Orchestrator Software set
personal windows.ps1 Full personal toolchain (Emacs, LaTeX, R, games-adjacent tools, …)
work windows_work.ps1 Subset focused on dev work; entertainment/personal apps commented out

To skip the prompt, pass flags:

.\setup-dotfiles.ps1 -Profile work -WorkMode full      # work + extended packages
.\setup-dotfiles.ps1 -Profile work -WorkMode minimal   # work, essentials only
.\setup-dotfiles.ps1 -Profile personal

After setup, configure your personal information:

cd $HOME\.local\share\chezmoi
.\fix-chezmoi-config.ps1

This prompts you for email/name/GitHub username and updates your git configuration. (Re-running setup-dotfiles.ps1 will not clobber the resulting chezmoi.toml.)

Authenticate with GitHub CLI (required for cloning private repos):

gh auth login

This enables passwordless git operations using GitHub CLI as the credential helper.

No Reboot Required

The orchestrators refresh the session's environment variables in-process via Invoke-RefreshEnv, so Vim, Emacs, pipenv, and the other post-install steps run inline. A reboot is only needed for:

  • WSL (after the feature is enabled the first time)
  • The Caps Lock ↔ Escape keyboard remap (takes effect on next sign-in)

Git Configuration

Chezmoi applies a global .gitconfig with these QoL settings:

Setting Value Purpose
core.excludesfile ~/.gitignore_global Ignores OS junk (Thumbs.db, .DS_Store), IDE dirs (.idea/, .vscode/), build artifacts, and more across all repos
core.autocrlf input Converts CRLF → LF on commit; avoids phantom diffs on Windows

The global gitignore covers:

  • OS files.DS_Store, Thumbs.db, Desktop.ini, $RECYCLE.BIN/
  • Editors/IDEs.vscode/, .idea/, *.swp, *.swo, *~, .sublime-*, .project, .settings/
  • Python__pycache__/, *.py[cod], .venv/, venv/, .env
  • Nodenode_modules/
  • Build artifacts*.o, *.obj, *.exe, *.dll, *.so, *.dylib
  • Logs*.log, npm-debug.log*

Note: All repos should also have their own .gitattributes with * text=auto eol=lf to enforce LF endings at the repo level.

Chezmoi Usage

A Makefile is included for common operations. Run make help for the full list, or use chezmoi directly:

Command Description
chezmoi apply -v Apply dotfiles to home directory
chezmoi diff Preview pending changes
chezmoi re-add Update source state from modified home files
chezmoi edit --apply <file> Edit a managed file and apply immediately
chezmoi git add . && chezmoi git commit -m "msg" && chezmoi git push Commit and push changes
chezmoi upgrade Upgrade chezmoi to latest version

You can customize the dotfiles by editing the files in ~/.local/share/chezmoi. Learn more about source state attributes in the Chezmoi reference.

Make targets

The Makefile works on Windows and Linux (cross-platform shell + pwsh). Targets that require Windows-specific tools error with a clear message on Linux.

Group Target Description
Chezmoi make apply Apply dotfiles to home directory
Chezmoi make dry-run Simulate apply and show what would change
Chezmoi make diff / status / update / re-add / cd Common chezmoi operations
Quality make lint Parse-check every .ps1/.psm1
Quality make analyze Run PSScriptAnalyzer (errors fail; warnings reported)
Quality make test Run Pester tests under tests/
Quality make check Run lint + analyze + test
Setup make doctor Report missing tools (chezmoi, git, pwsh, choco/winget on Windows)
Setup make hooks Install git pre-commit hook (gitleaks secret scan on staged files)
Windows make install Run the full Windows installation script
Windows make upgrade Upgrade chezmoi via Chocolatey

make doctor is a good first check on a new machine. Run it before make install to catch missing prerequisites early.

Commands

Run aliases in PowerShell to open all profile and module files for editing. Key shell functions:

Command Description
update Upgrade Chocolatey packages and Windows
updateall Upgrade everything including Vim plugins
cleanup Run choco-cleaner and Vim plugin cleanup
sudo / su Launch an elevated PowerShell window
g, ga, gc, gs, gp Git shortcuts (git, add, commit, status, push)
pull, fetch, yolo Recursive git operations across all repos
cr cd to ~/repos
ce <file> chezmoi edit --apply shortcut
vim Launches Neovim

Chocolatey

Upgrade packages

choco upgrade all

List installed packages

choco list

PowerShell

All profiles source a single shared config at ~/.local/scripts/profile_common.ps1. This works for both PowerShell 7+ and Windows PowerShell 5.1, and across Documents and OneDrive folder locations.

To check which profile is being loaded:

$PROFILE | Format-List -Force

Task Scheduler

To add a task at login, use the schtasks command. Example:

schtasks /create /tn "TaskName" /tr "command" /sc onlogon

Note: If user and computer name differ, you may need to adjust the task's user account via the Task Scheduler GUI.

Recover Windows Boot EFI

Emergency procedure to restore a missing Windows boot entry. Video guide.

c:\windows is your healthy Windows installation. v: is the EFI partition:

bcdboot c:\windows /s v: /f UEFI

PARA Drive Sync

Helpers for keeping a local PARA folder tree in sync with a Google Drive Stream mount, with safe handling of .gdoc/.gsheet pointers and emoji/accented paths. See docs/DRIVE_SYNC.md.

Development

CI runs PSScriptAnalyzer and Pester on every push. Both can be run locally:

Invoke-ScriptAnalyzer -Path . -Recurse -Settings .\PSScriptAnalyzerSettings.psd1
Invoke-Pester ./tests -Output Detailed

The VS Code PowerShell extension auto-discovers PSScriptAnalyzerSettings.psd1 at the workspace root, so editor warnings match CI.

License

MIT.

About

Windows 11 dotfiles and configuration.

Topics

Resources

License

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors