Managed with GNU Stow. Each top-level
directory is a package whose contents mirror $HOME.
xcode-select --install
git clone git@github.com:ColinTheRobot/dot_files.git ~/prs_dev/dot_files
~/prs_dev/dot_files/install.sh --lang java --lang work # or --lang ruby, etc.install.sh is safe to rerun. It:
- Adds any
--langlanguages to~/.config/dotfiles/langs(see Languages), and any--java-versions to~/.config/dotfiles/java-versions(see Java versions). Later runs without these flags use what's in those files. - Installs Homebrew if it's missing and adds
brew shellenvto~/.zprofile. - Runs
brew bundleon theBrewfileplus each enabled language'slangs/<lang>/Brewfile. - Stows
nvim,tmuxandzsh. Any existing non-symlink~/.zshrc,~/.tmux.conf,~/.config/nvimor~/.config/zshis moved aside to*.origfirst. - Runs
langs/<lang>/install.shfor each enabled language. - Clones TPM at
TPM_VERSIONand installs the tmux plugins listed in.tmux.conf(tmux-pomodoro-plus). - Restores Neovim plugins from
lazy-lock.json.
Notes:
- The
Brewfilelists the formulae and casks every machine gets; language tooling goes inlangs/<lang>/Brewfile. After installing something new with brew, add it to the right one.scripts/brewfile.shcombines the base Brewfile with this machine's languages and prints the combined file's path, so check and clean up against that rather than the base file alone:brew bundle check --file "$(scripts/brewfile.sh)"reports anything missing, andbrew bundle cleanup --file "$(scripts/brewfile.sh)"lists what's installed but not in it. tree-sitter-clibuilds the parsers nvim-treesitter installs.ripgrepbacks fzf-lua'slive_grep(<C-g>,<leader>fg).- Set your terminal font to "JetBrainsMono Nerd Font" so
nvim-web-deviconsrenders. - Claude Code (
claudeCLI, installed by the Brewfile) connects to Neovim throughclaudecode.nvim: run/idein Claude Code. Keymaps:<leader>abadds the buffer,<leader>assends the selection,<leader>aa/<leader>adaccept or deny a diff.
.zshenv holds secrets (tokens, API keys) and is gitignored, so it isn't in
this repo. Create it by hand and export whatever environment variables you
need there. It's sourced before .zshrc.
Project-specific environment variables (for example, work Docker or Testcontainers settings) belong here too, not in the repo.
Open a new shell, then open nvim and let it finish bootstrapping:
install.shalready restored plugins fromlazy-lock.json. Run:Lazy restoreto resync to the lockfile, or:Lazy updateto upgrade and then commit the updated lockfile.- The
junegunn/fzfplugin builds the fzf binary and runs./install --all, which writes~/.fzf.zsh. Open a new shell afterwards to get fzf's shell keybindings. - With java enabled, Mason installs
jdtlsandlemminx. Check progress with:Mason. Java buffers won't get LSP features until jdtls (and its bundledlombok.jar) has finished installing. - Debugging and running Java tests need two more Mason packages that aren't
installed automatically:
:MasonInstall java-debug-adapter java-test, then reopen the Java buffer so jdtls loads their bundles.
Everything for every language lives in this repo, but each machine only
installs and loads the languages listed in ~/.config/dotfiles/langs, one per
line. That file isn't in the repo, so pulling a commit that changes another
language's setup never installs anything on this machine. install.sh --lang <name> adds a language to the file and installs it.
| Layer | Java | Ruby |
|---|---|---|
| Homebrew | langs/java/Brewfile: openjdk, maven, mysql |
langs/ruby/Brewfile: rbenv, ruby-build, libyaml |
| Install | langs/java/install.sh: SDKMAN and this machine's JDKs |
langs/ruby/install.sh: rbenv RUBY_VERSIONS, plus bundler and ruby-lsp for each |
| Shell | ~/.config/zsh/langs/java.zsh: openjdk PATH, SDKMAN, spring |
~/.config/zsh/langs/ruby.zsh: rbenv, ulimit, run_modified_specs |
| Neovim | plugins/lang/java.lua (nvim-jdtls, nvim-dap), ftplugin/java.lua; Mason installs jdtls and lemminx |
plugins/lang/ruby.lua (vim-rails), ftplugin/ruby.lua, after/lsp/ruby_lsp.lua |
.zshrcsources~/.config/zsh/langs/<lang>.zshfor each enabled language. All of them are stowed; only enabled ones are sourced.- In Neovim,
require("config.langs").enabled("<lang>")reports whether a language is on. Language plugins usecond =with it rather thanenabled =, so a language that's off isn't installed but keeps its entry inlazy-lock.json, and committing the lockfile from one machine doesn't drop another machine's plugins. - ruby-lsp isn't installed by Mason. It's a gem in each rbenv Ruby, run through the rbenv shim so it uses the project's Ruby and bundle.
To add a language, create langs/<name>/ with a Brewfile and/or an
executable install.sh, add zsh/.config/zsh/langs/<name>.zsh and
nvim/.config/nvim/lua/plugins/lang/<name>.lua as needed, and gate anything
that installs (Mason servers, treesitter parsers) on langs.enabled("<name>").
Each machine lists its JDKs in ~/.config/dotfiles/java-versions (not in the
repo), one SDKMAN identifier per line, such as
21.0.12-tem. The first one is the default java. latest installs the
newest Corretto, looked up on each run, so a rerun picks up new releases (older
ones stay installed).
The first time java is installed, install.sh asks for the versions (Enter
for latest). To set them without the prompt, or to change them later, pass
--java-version once per JDK. This replaces the file and enables java:
./install.sh --java-version latest
./install.sh --java-version 25.0.4-amzn --java-version 21.0.12-tem --java-version 25.0.4-temYou can also edit the file and rerun install.sh. JDKs removed from the list
aren't uninstalled; use sdk uninstall java <id>. Neovim's Java test runner
uses 21.0.12-tem when it's installed, otherwise the default JDK.
work isn't a language but works the same way, for things only the work
machine needs. langs/work/Brewfile has the work apps (Slack, Linear,
Outlook, Notion, Bruno, TablePlus) and colima/Docker. langs/work/install.sh
registers the docker compose plugin, starts the colima VM (4 CPU, 8 GiB
memory, 60 GiB disk, vz, virtiofs) and switches Docker to the colima
context.
mkdir -p <pkg>/<path relative to $HOME>
mv ~/<file> <pkg>/<path relative to $HOME>/
stow -t ~ <pkg>Use stow -t ~ -D <pkg> to remove a package's symlinks.