This is not your regular collection of settings; it's a cohesive, highly-opinionated, and continuously evolving development ecosystem, meticulously crafted for macOS. It's a testament to the power of a keyboard-centric workflow, intelligent automation, and deep tool integration.
This setup integrates Beads, a graph-based issue tracker that provides long-term memory for coding agents. Beads enables agents to track complex, multi-step tasks with dependencies, ensuring no work is lost and allowing seamless continuation across sessions.
Agents in this environment will automatically use bd commands for planning and tracking, creating a shared, git-synced database of issues across machines.
-
Install 1Password: The entire setup hinges on the 1Password CLI and its SSH agent for managing secrets and identities.
-
Initialize Chezmoi: This single command will bootstrap the entire environment.
```bash sh -c "$(curl -fsLS get.chezmoi.io/lb)" -- init --apply kapral18 ```
This setup's power comes from the deep integration between Chezmoi for management and ASDF for runtime versioning.
Chezmoi is more than a dotfile symlinker; it's the brain of the operation, using templates and scripts to build a configuration tailored to the specific machine.
- Conditional Logic (
.isWork): Many files are templates (*.tmpl). They use a{{ .isWork }}variable to conditionally include or exclude configurations. This is how the setup seamlessly manages different Git identities, SSH keys, and even installed ASDF plugins for personal vs. work machines. - External Tools & Scripts: Chezmoi manages a
~/bindirectory of custom scripts. Theexecutable_prefix in a filename tells Chezmoi to set the executable bit, making these scripts instantly available in thePATH. - Automated Setup Scripts: The
f-apply-app-iconsscript is a perfect example. It's a shell script template that usesyqto parse a YAML definition (app_icons/icon_mapping.yaml) and thefileiconutility to apply beautiful custom icons to applications in/Applications. This entire customization is applied automatically withchezmoi apply.
ASDF is used to manage versions of nearly every tool and language, ensuring reproducible environments.
- Declarative Plugin Management (
asdf_plugins.tmpl): The list of ASDF plugins is not static; it's a Chezmoi template. This allows for conditionally installing plugins (likelua) only in a personal environment. - Declarative Versioning (
.tool-versions.tmpl): The.tool-versionsfile, the source of truth for what version of a tool to use, is also a template. This allows for different tool versions between environments if needed. - Automatic Version Switching: The shell configuration files
(
config.fish,.zshrc, etc.) are set up to initialize ASDF. Thanks to ASDF's shims and the.tool-versionsfile, simplycd-ing into a project directory will automatically make the correct versions of Node.js, Ruby, Go, etc., available in your shell. No manual switching is ever required.
The primary shell is Fish, but Zsh and Bash are also fully configured for consistency.
This is the crown jewel of the shell environment, turning Git's powerful but
clunky worktree feature into a seamless, everyday tool.
-
f-wtree add <branch> [base_branch]: An incredibly smart function that handles numerous scenarios:- Creates a worktree from an existing local branch.
- Creates a worktree from a remote branch on
originorupstream. - Handles branches from forks (e.g.,
f-wtree add some-user/feature-branch). - Creates a new branch from
HEADif the branch doesn't exist anywhere. - Organizes worktrees by creating nested directories for branches with
slashes (e.g.,
feature/new-ui).
-
f-wtree prs <pr_numbers_or_search>: A massive time-saver. Type a PR number or search term, and it will:- Use
fzfto let you select the exact PR with a rich preview. - Fetch PR details from the GitHub API.
- Add the contributor's fork as a temporary remote.
- Create a worktree for the PR's branch.
- Use
-
f-wtree remove: Anfzf-powered interactive worktrees remover that:- Removes each selected worktree directory.
- Deletes the associated local branch.
- Cleans up the remote: If the worktree was from a fork, it removes the temporary remote if no other worktrees are using it.
- Cleans up the filesystem: Removes any empty parent directories.
- Removes the path from
zoxide's database.
-
Tmux Integration: The worktree functions are tightly integrated with Tmux. A new, named Tmux session is created when a worktree is added and killed when it's removed, making context-switching effortless.
The repository includes an extensive collection of custom scripts and utilities
designed to enhance productivity and automate common development tasks. These
scripts are located in ~/bin (managed by chezmoi) and provide powerful
functionality:
f-add-patch-to-prs: Adds patch files to existing PRs for easy updatesf-wtree: Enhanced git worktree management with automatic branch creation and remote handlingf-appid: Retrieves application identifiers for macOS apps for automationf-apply-app-icons: Applies custom icons to applications based on YAML mapping definitionsf-bat-preview: Uses bat for file preview with syntax highlighting in fuzzy findersf-check-backport-progress: A powerful script for repository maintainers. It uses theghCLI to find PRs with specific labels and checks if they have been correctly backported to release branches.f-cp-files-for-llm: Recursively finds all text files in a directory, concatenates their contents (with file headers), and copies it to the clipboard, ready for pasting into an LLM.f-dumputi: Custom utility functions for various development tasksf-get-risky-tests: Identifies potentially flaky or risky tests in test suitesf-gh-subissues-create: Creates GitHub sub-issues for detailed task breakdownf-grepo: Enhanced git repository operations and navigation utilitiesf-history-sync: Synchronizes fish shell history via 1Password for seamless history across devicesf-list-prs: Lists GitHub PRs with advanced filtering and search capabilitiesf-pdf-diff: A visual diff tool for PDFs. It uses ImageMagick to render two PDFs as images and composites them, highlighting all differences in red.f-fuzzy-brew-search: Interactive search through Homebrew package descriptions with fzf selectionf-search-gh-topic: Searches GitHub repositories by topic with fuzzy filteringf-tmux-lowfi: A clever script that controls alowfimusic player running inside a dedicated, detached tmux session. You can play, pause, and skip tracks from any terminal window without interrupting your workflow.f-to-gif: Converts videos to optimized GIFs with quality and size controlsf-vid-ipad: Processes videos for iPad optimization and format conversion- **GitHub PR Management (
f-disable-auto-merge,f-enable-auto-merge): Functions to bulk-disable/enable auto-merge on PRs, useful for managing release branches.
All scripts are designed with consistent error handling, self-documenting help text, and follow established naming conventions. Fish shell completions are provided for all scripts for enhanced usability.
The Git configuration is a masterclass in efficiency, safety, and identity management.
This is a game-changing solution for managing multiple Git identities (e.g., personal and work) on the same machine securely and automatically.
How it works:
- The global
.gitconfigsets ansshCommandoverride:sshCommand = ssh -o IdentitiesOnly=yes -o IdentityFile="~/.ssh/primary_public_key.pub"- Crucially,
IdentityFilepoints to the public key. 1Password's SSH agent intercepts this and uses the corresponding private key from the vault for signing.- A conditional include,
[includeIf "gitdir:~/work/"], loads a separate.gitconfigfor work projects.- The work-specific
.gitconfigoverrides thesshCommandagain, this time pointing to the work public key.The result: Git automatically uses the correct SSH key for signing and authentication based on the directory you're in, all without exposing private keys on disk or juggling complex
~/.ssh/configfiles. It's secure, seamless, and fully automated.
- Powerful Aliases:
git wtgrab <worktree_path>: "Grabs" uncommitted changes from another worktree by creating a diff, resetting the source worktree, and applying the diff to your current one.git squash <n>: An interactive one-liner to squash the lastncommits, pre-filling the new commit message with the old ones.git u: Your daily driver. A single command to fetch, pull with rebase, and purge old, merged branches.git hide/unhide <file>: Usesupdate-index --assume-unchangedto tell Git to ignore changes to a tracked file, perfect for local config overrides.
- Smarter Defaults:
rerere(reuse recorded resolution) is enabled to make resolving repeated merge conflicts automatic.rebase.autoSquash = truemakesgit rebase -iautomatically handlefixup!andsquash!commits.rebase.updateRefs = truemakes rebasing stacked branches much safer.- The superior
histogramdiff algorithm andzdiff3conflict style are defaults. feature.manyFiles = true: Opts into a newer, faster index format for repositories with a large number of files.
The Tmux setup is designed for a seamless, keyboard-driven experience that integrates perfectly with Neovim.
- Ergonomic Prefix: The prefix is remapped from
C-bto the more accessibleC-Space. - Plugin-Powered Workflow:
tpm: The plugin manager itself.tmux-resurrect&tmux-continuum: Your session is automatically saved every 15 minutes and restored on startup. Never lose your layout again.tmux-pain-control: Provides easy, repeatable keybindings for resizing and swapping panes.tmux-sessionist: A powerful session manager for quickly switching between projects.tmux-fzf-url: A killer feature. Press a key to scan your entire scrollback buffer for URLs and open one in your browser usingfzf.tmux-theme-catppuccin: Provides the beautiful, consistent theme.
- Neovim Passthrough: Keybindings like
Ctrl-Shift-h/j/k/lare configured to be passed through Tmux directly to the running application, allowing for seamless window resizing and navigation inside Neovim without conflicting with Tmux's own keys. - Vi Mode: Pane navigation and copy mode use Vi keybindings for consistency with Neovim.
This is a heavily customized setup, transformed into a bespoke IDE.
- The Dynamic Winbar (
options.lua): A custom-built marvel that displays the truncated path of the current file relative to the project root, ensuring you always know where you are without cluttering the bufferline. - The Supercharged Tab Key (
tab-behavior.lua): A context-aware powerhouse that accepts Copilot suggestions, jumps through snippets, and tabs out of brackets/quotes. - Minimalist Code View: Long, noisy
classNameattributes are concealed to a singleβ¦character. - Custom Keymaps (
keymaps.lua):jkis mapped to<ESC>,<A-j/k>jumps 10 lines, and<C-A-j/k>moves lines up and down.
- Interactive Filtered LSP (
fzf-filters-lsp.lua): A killer feature! When searching for definitions or references, you get an interactive prompt to filter out irrelevant files (tests,node_modules) and content (imports). It even displays the file's CODEOWNERS in the results! - Advanced Jest Runner (
run-jest-in-split.lua): A complete testing suite that can run the specificdescribe/itblock your cursor is in, handle parameterized tests, run in debug mode, and update snapshots. - AI-Powered Commits (
summarize-commit.lua): Generate a conventional commit message from your staged changes using Ollama, Cloudflare AI, or OpenRouter with a single keypress. - TypeScript Refactoring (
ts-move-exports.lua): A custom tool to select a block of exported code, move it to a new file, and automatically update all import paths across the project. - Source/Test Switching (
switch-src-test.lua): A smart<C-^>mapping to instantly jump between a source file and its corresponding test file.
LargeFilesCommand: Finds files in your project that exceed a certain line count.CpFromDownloadsCommand: A Neo-tree helper to quickly construct acpcommand from your~/Downloadsfolder.owner-code-search.lua: Custom commands to search only within files owned by a specific team, as defined inCODEOWNERS.show-file-owner.lua: A quick command to display the owner of the current file.
- Hammerspoon for Total Control:
gridmouse.lua: A complete, Vi-like mouse control system. Activate it and useh/j/k/lto move the mouse, or enter Grid Mode to jump the cursor to precise screen locations with just a few keystrokes.- Window Management (
window.lua): Simple, fast hotkeys (Hyper + h/j/k/l/m) to snap windows to half/full screen positions.
- Custom App Icons (
f-apply-app-icons): A script that applies beautiful custom icons to your applications for a clean, consistent look.
