<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Jian Yuan Lee</title>
    <description>The latest articles on DEV Community by Jian Yuan Lee (@jianyuan).</description>
    <link>https://dev.to/jianyuan</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F77479%2F801fa148-47bc-43cc-bd2d-b0f4dc1aae0d.jpeg</url>
      <title>DEV Community: Jian Yuan Lee</title>
      <link>https://dev.to/jianyuan</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/jianyuan"/>
    <language>en</language>
    <item>
      <title>A Guided Tour of My Dotfiles</title>
      <dc:creator>Jian Yuan Lee</dc:creator>
      <pubDate>Wed, 18 Nov 2026 11:49:00 +0000</pubDate>
      <link>https://dev.to/jianyuan/a-guided-tour-of-my-dotfiles-4n73</link>
      <guid>https://dev.to/jianyuan/a-guided-tour-of-my-dotfiles-4n73</guid>
      <description>&lt;p&gt;&lt;a href="https://github.com/jianyuan/dotfiles" rel="noopener noreferrer"&gt;jianyuan/dotfiles on GitHub&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Over the years I've trimmed my development environment down to something small and reproducible that I can set up on any machine in a few minutes. When I get a new machine, I don't spend hours installing apps by hand or copying terminal configs across. I clone one repository, run &lt;code&gt;./install&lt;/code&gt; and wait.&lt;/p&gt;

&lt;p&gt;This post walks through how it works. The main tools are Dotbot, Homebrew Bundle and Git Town.&lt;/p&gt;

&lt;h2&gt;
  
  
  The directory structure
&lt;/h2&gt;

&lt;p&gt;My dotfiles live in a GitHub repository, &lt;a href="https://github.com/jianyuan/dotfiles" rel="noopener noreferrer"&gt;jianyuan/dotfiles&lt;/a&gt;, laid out like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;dotfiles/
├── Brewfile
├── gitconfig
├── gitconfig_global
├── install
├── install.conf.yaml
├── renovate.json
└── direnv/
    └── direnv.toml
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The &lt;code&gt;Brewfile&lt;/code&gt; installs apps, command-line tools and fonts. The &lt;code&gt;install&lt;/code&gt; script and &lt;code&gt;install.conf.yaml&lt;/code&gt; run Dotbot, which symlinks the configs into place. The rest are config files for Git and &lt;code&gt;direnv&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Symlinking with Dotbot
&lt;/h2&gt;

&lt;p&gt;A hand-written bash script for symlinking files into my home directory breaks easily, so I use &lt;a href="https://github.com/anishathalye/dotbot" rel="noopener noreferrer"&gt;Dotbot&lt;/a&gt;, which does the job from a short YAML file.&lt;/p&gt;

&lt;h3&gt;
  
  
  The &lt;code&gt;install&lt;/code&gt; script
&lt;/h3&gt;

&lt;p&gt;The &lt;code&gt;install&lt;/code&gt; script pulls in Dotbot as a Git submodule, initialises it and runs it with my config file:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;#!/usr/bin/env bash&lt;/span&gt;
&lt;span class="nb"&gt;set&lt;/span&gt; -euo pipefail

&lt;span class="nv"&gt;CONFIG&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"install.conf.yaml"&lt;/span&gt;
&lt;span class="nv"&gt;DOTBOT_DIR&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"dotbot"&lt;/span&gt;
&lt;span class="nv"&gt;DOTBOT_BIN&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"bin/dotbot"&lt;/span&gt;
&lt;span class="nv"&gt;BASEDIR&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"$(cd "&lt;/span&gt;&lt;span class="nv"&gt;$(&lt;/span&gt;dirname &lt;span class="s2"&gt;"${BASH_SOURCE[0]}"&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;&lt;span class="s2"&gt;" &amp;amp;&amp;amp; pwd)"&lt;/span&gt;

&lt;span class="nb"&gt;cd&lt;/span&gt; &lt;span class="s2"&gt;"${BASEDIR}"&lt;/span&gt;
git -C &lt;span class="s2"&gt;"${DOTBOT_DIR}"&lt;/span&gt; submodule sync --quiet --recursive
git submodule update --init --recursive &lt;span class="s2"&gt;"${DOTBOT_DIR}"&lt;/span&gt;

&lt;span class="s2"&gt;"${BASEDIR}/${DOTBOT_DIR}/${DOTBOT_BIN}"&lt;/span&gt; -d &lt;span class="s2"&gt;"${BASEDIR}"&lt;/span&gt; -c &lt;span class="s2"&gt;"${CONFIG}"&lt;/span&gt; &lt;span class="s2"&gt;"${@}"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  The config: &lt;code&gt;install.conf.yaml&lt;/code&gt;
&lt;/h3&gt;

&lt;p&gt;This file tells Dotbot what to do. It sets defaults for links, creates the symlinks, removes dead links, makes sure my projects directory exists and then installs my packages:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="na"&gt;defaults&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;link&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
      &lt;span class="na"&gt;create&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;
      &lt;span class="na"&gt;relink&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;

&lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="na"&gt;link&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;~/.gitconfig&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;~/.gitignore_global&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;~/.config/direnv&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;direnv&lt;/span&gt;

&lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="na"&gt;clean&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'~'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;

&lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="na"&gt;create&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="s"&gt;~/code&lt;/span&gt;

&lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="na"&gt;shell&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="na"&gt;command&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;brew bundle install&lt;/span&gt;
      &lt;span class="na"&gt;stdout&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Defaults
&lt;/h4&gt;

&lt;p&gt;The defaults apply to every link unless a link overrides them:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;create&lt;/code&gt; makes any missing parent directories before creating a symlink.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;relink&lt;/code&gt; replaces an existing symlink with the same name, so reruns don't fail on conflicts.&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  Link
&lt;/h4&gt;

&lt;p&gt;The &lt;code&gt;link&lt;/code&gt; section lists the files and directories in the repository that get symlinked into my home directory. Each entry maps a target path in my home directory to a source in the repository.&lt;/p&gt;

&lt;h4&gt;
  
  
  Clean
&lt;/h4&gt;

&lt;p&gt;&lt;code&gt;clean&lt;/code&gt; removes dead symlinks, the ones pointing at files that no longer exist. I point it at my home directory (&lt;code&gt;~&lt;/code&gt;), so anything I've deleted from the repository doesn't leave a broken link behind.&lt;/p&gt;

&lt;h4&gt;
  
  
  Create
&lt;/h4&gt;

&lt;p&gt;&lt;code&gt;create&lt;/code&gt; makes directories that don't exist yet. I use it for &lt;code&gt;~/code&lt;/code&gt;, so my projects always live in the same place.&lt;/p&gt;

&lt;h4&gt;
  
  
  Shell
&lt;/h4&gt;

&lt;p&gt;The &lt;code&gt;shell&lt;/code&gt; section runs commands after the linking and cleanup are done. The &lt;code&gt;stdout&lt;/code&gt; option controls whether I see a command's output. Here it runs &lt;code&gt;brew bundle install&lt;/code&gt;, which installs everything in my Brewfile.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Packages with Homebrew (&lt;code&gt;Brewfile&lt;/code&gt;)
&lt;/h2&gt;

&lt;p&gt;A Brewfile replaces a long list of &lt;code&gt;brew install&lt;/code&gt; commands. &lt;code&gt;brew bundle install&lt;/code&gt; reads it and installs everything, from command-line tools to GUI apps and fonts.&lt;/p&gt;

&lt;p&gt;Here's what's in mine:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;For the terminal, &lt;code&gt;fzf&lt;/code&gt; for fuzzy finding, &lt;code&gt;ripgrep&lt;/code&gt; (&lt;code&gt;rg&lt;/code&gt;), &lt;code&gt;fd&lt;/code&gt;, &lt;code&gt;tmux&lt;/code&gt; and &lt;code&gt;neovim&lt;/code&gt;. I use &lt;code&gt;mise&lt;/code&gt; to manage runtimes and dev environments, and &lt;code&gt;zoxide&lt;/code&gt; as a smarter &lt;code&gt;cd&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;For Git, the usual &lt;code&gt;git&lt;/code&gt; and the GitHub CLI (&lt;code&gt;gh&lt;/code&gt;), plus &lt;code&gt;tig&lt;/code&gt; for browsing history in the terminal and &lt;code&gt;git-town&lt;/code&gt; for managing branches.&lt;/li&gt;
&lt;li&gt;For containers and VMs, &lt;code&gt;colima&lt;/code&gt; runs Docker without Docker Desktop, alongside the &lt;code&gt;docker&lt;/code&gt; CLI tools, and &lt;code&gt;utm&lt;/code&gt; runs virtual machines.&lt;/li&gt;
&lt;li&gt;Mac apps installed as casks, including &lt;code&gt;raycast&lt;/code&gt;, &lt;code&gt;bitwarden&lt;/code&gt;, &lt;code&gt;tailscale-app&lt;/code&gt; and &lt;code&gt;nordvpn&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Cascadia Code Nerd Font (&lt;code&gt;font-cascadia-code-nf&lt;/code&gt;), which has programming ligatures and the Nerd Font icons.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  3. Git
&lt;/h2&gt;

&lt;p&gt;My &lt;code&gt;.gitconfig&lt;/code&gt; signs commits, rebases on pull, sets up the remote branch on the first push and uses &lt;code&gt;gh&lt;/code&gt; for GitHub authentication. It also has a set of aliases for Git Town.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s"&gt;user&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
    &lt;span class="s"&gt;name = Your Name&lt;/span&gt;
    &lt;span class="s"&gt;email = your-email@example.com&lt;/span&gt;
&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s"&gt;core&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
    &lt;span class="s"&gt;excludesfile = ~/.gitignore_global&lt;/span&gt;
&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s"&gt;commit&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
    &lt;span class="s"&gt;gpgsign = true&lt;/span&gt;
&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s"&gt;pull&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
    &lt;span class="s"&gt;rebase = true&lt;/span&gt;
&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s"&gt;push&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
    &lt;span class="s"&gt;autoSetupRemote = true&lt;/span&gt;
&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s"&gt;credential&lt;/span&gt; &lt;span class="s2"&gt;"https://github.com"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
    &lt;span class="s"&gt;helper =&lt;/span&gt;
    &lt;span class="s"&gt;helper = !/opt/homebrew/bin/gh auth git-credential&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Git Town
&lt;/h3&gt;

&lt;p&gt;Git Town automates the branch housekeeping in a Git workflow: creating feature branches, stacking changes and keeping branches in sync with the main branch. I alias its commands so I can type &lt;code&gt;git sync&lt;/code&gt; instead of &lt;code&gt;git town sync&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight toml"&gt;&lt;code&gt;&lt;span class="k"&gt;[alias]&lt;/span&gt;
    &lt;span class="na"&gt;append&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;town&lt;/span&gt; &lt;span class="nb"&gt;append&lt;/span&gt;
    &lt;span class="na"&gt;compress&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;town&lt;/span&gt; &lt;span class="n"&gt;compress&lt;/span&gt;
    &lt;span class="na"&gt;contribute&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;town&lt;/span&gt; &lt;span class="n"&gt;contribute&lt;/span&gt;
    &lt;span class="na"&gt;hack&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;town&lt;/span&gt; &lt;span class="n"&gt;hack&lt;/span&gt;
    &lt;span class="na"&gt;sync&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;town&lt;/span&gt; &lt;span class="n"&gt;sync&lt;/span&gt;
    &lt;span class="na"&gt;ship&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;town&lt;/span&gt; &lt;span class="n"&gt;ship&lt;/span&gt;
    &lt;span class="c1"&gt;# ... shortcuts for prepend, propose, rename, and observe
&lt;/span&gt;&lt;span class="k"&gt;[git-town]&lt;/span&gt;
    &lt;span class="na"&gt;sync-feature-strategy&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;rebase&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A &lt;code&gt;.gitignore_global&lt;/code&gt; keeps the usual junk out of every repository: compiled objects (&lt;code&gt;.o&lt;/code&gt;, &lt;code&gt;.so&lt;/code&gt;), packages, local SQLite files, &lt;code&gt;.DS_Store&lt;/code&gt;, and &lt;code&gt;.env&lt;/code&gt; and &lt;code&gt;.envrc&lt;/code&gt; files, so I can't stage secrets by accident.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. Per-project environments with &lt;code&gt;direnv&lt;/code&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;direnv&lt;/code&gt; hooks into the shell and loads or unloads environment variables as you change directories.&lt;/p&gt;

&lt;p&gt;I change one setting in &lt;code&gt;direnv/direnv.toml&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight toml"&gt;&lt;code&gt;&lt;span class="k"&gt;[global]&lt;/span&gt;
&lt;span class="na"&gt;load_dotenv&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;With &lt;code&gt;load_dotenv = true&lt;/code&gt;, when I &lt;code&gt;cd&lt;/code&gt; into a project with a &lt;code&gt;.env&lt;/code&gt; file, &lt;code&gt;direnv&lt;/code&gt; exports its values into my shell, so I don't have to source it myself.&lt;/p&gt;

&lt;h2&gt;
  
  
  Keeping it up to date
&lt;/h2&gt;

&lt;p&gt;Dotfiles go stale. Tools update and schemas change, and things break. To keep up, I added a &lt;code&gt;renovate.json&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;"$schema"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"https://docs.renovatebot.com/renovate-schema.json"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;"extends"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"config:recommended"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;With Renovate turned on for the repository, I get a pull request whenever a dependency or config schema has an update, and I barely have to think about it.&lt;/p&gt;

&lt;h2&gt;
  
  
  Setting up a new machine
&lt;/h2&gt;

&lt;p&gt;When I wipe my Mac or get a new one, setup is two steps:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Step 1: Clone the environment&lt;/span&gt;
git clone https://github.com/jianyuan/dotfiles.git ~/dotfiles

&lt;span class="c"&gt;# Step 2: Install everything&lt;/span&gt;
&lt;span class="nb"&gt;cd&lt;/span&gt; ~/dotfiles
./install
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A few minutes later, Dotbot has linked my configs, Homebrew has installed my apps and tools, and my terminal is ready to use.&lt;/p&gt;

&lt;p&gt;The full configs are at &lt;a href="https://github.com/jianyuan/dotfiles" rel="noopener noreferrer"&gt;jianyuan/dotfiles&lt;/a&gt; if you want to fork the repository or borrow a few pieces.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/jianyuan/dotfiles" rel="noopener noreferrer"&gt;jianyuan/dotfiles on GitHub&lt;/a&gt;&lt;/p&gt;

</description>
      <category>shell</category>
      <category>productivity</category>
    </item>
  </channel>
</rss>
