holman-dotfiles

repository·master·Indexed 27 days ago

https://github.com/holman/dotfiles

A topic-centric dotfiles repository designed for forking and customization. It uses a structured directory approach to manage shell configurations, symlinks, and binaries by topic area. Includes a suite of custom CLI utilities for macOS battery status, DNS flushing, and extensive Git workflow enhancements such as git-wtf, git-promote, and git-undo.

Tokens
3.4K
Snippets
9
Records
37
Agent score
88%

What's inside holman-dotfiles

  1. Understand the topic-centric file structure

    master

    The dotfiles are organized by topic areas. You can add new topics by creating a directory (e.g., java/) and placing files within it. The system handles files based on their extensions:

    • *.zsh: Automatically included in your shell environment.
    • *.symlink: Symlinked into $HOME (without the extension) when running script/bootstrap.
  2. Use the `dot` script to maintain your environment

    master
    The dot script is located in bin/. It is used to install dependencies, set macOS defaults, and keep your environment up-to-date. You can tweak this script to suit your specific needs and run it occasionally.
  3. Install the dotfiles

    master

    To install these dotfiles, clone the repository to your ~/.dotfiles directory, navigate into it, and run the bootstrap script. This will symlink the appropriate files from the repository into your home directory.

    Note: You may need to modify zsh/zshrc.symlink immediately after installation to accommodate paths specific to your machine.

    git clone https://github.com/holman/dotfiles.git ~/.dotfiles
    cd ~/.dotfiles
    script/bootstrap
  4. Use git-wtf to summarize repository state

    master

    The git-wtf CLI tool displays the state of your Git repository in a readable format. It is designed to show how branches relate to remote servers and how feature branches relate to integration branches (e.g., master, next, edge). It is most effective when used before a git push or between a git fetch and a git merge.

    Usage

    Run the command without arguments to inspect the current branch, or specify a branch name:

    git wtf [branch+] [options]

    Key Indicators

    git-wtf uses specific symbols to denote branch status:

    • (): Branch only exists locally
    • {}: Branch only exists on a remote repo
    • []: Branch exists both locally and remotely
    • x: Merge occurs both locally and remotely
    • ~: Merge occurs only locally
    • : Branch isn't merged in
    git wtf
  5. Configure git-wtf via .git-wtfrc

    master

    If git-wtf incorrectly identifies your integration branches (it defaults to master, next, and edge), you can create a .git-wtfrc configuration file. The tool searches for this file in the current directory and recursively up to the repository root.

    Setup

    To generate a template configuration file, run:

    git-wtf --dump-config > .git-wtfrc

    Configuration Schema

    The file is a YAML file that supports the following keys:

    • integration-branches: A list of branches considered integration branches (e.g., heads/master).
    • ignore: A list of branches to ignore.
    • max_commits: The maximum number of commits to display when --all-commits is not used.

    Important Note on Naming:

    • Local branches must be prefixed with heads/ (e.g., heads/master).
    • Remote branches must be of the form remotes/<remote>/<branch>.
    git-wtf --dump-config > .git-wtfrc
  6. Reference the special file hierarchy and loading order

    master

    The following file locations and naming conventions trigger specific behaviors during setup or shell initialization:

    • bin/*: Files in this directory are added to your $PATH and are available globally.
    • topic/*.zsh: Files loaded into your environment.
    • topic/path.zsh: Loaded first; used to set up $PATH and similar variables.
    • topic/completion.zsh: Loaded last; used to set up autocomplete.
    • topic/install.sh: Executed when running script/install. (Uses .sh to avoid automatic shell loading).
    • topic/*.symlink: Symlinked into $HOME when running script/bootstrap.
  7. Configure git-rank-contributors output flags

    master

    The git-rank-contributors CLI supports several flags to modify how author information is displayed:

    • -v (verbose): Displays the author followed by the number of lines of diff they are responsible for (e.g., Author Name: 123 lines of diff).
    • -o (obfuscate): Obfuscates email addresses in the output (e.g., replacing @ with at the and . with dot).
    • -h (htmlize): Escapes HTML special characters (&, <, >) in the output.
  8. git-wtf CLI options reference

    master

    The following options are available for the git wtf command:

    FlagLong OptionDescription
    -l--longInclude author info and date for each commit
    -a--allShow all branches across all remote repos, not just origin
    -A--all-commitsShow all commits, not just the first 5
    -s--shortDo not show commits
    -k--keyShow the status key legend
    -r--relationsShow relation to feature / integration branches
    --dump-configPrint out current configuration and exit
  9. Use the gitio CLI to shorten GitHub URLs

    master

    The gitio command converts a github.com URL into a shortened git.io URL and automatically copies the resulting URL to your clipboard.

    Usage

    gitio URL [CODE]

    • URL: The GitHub URL you want to shorten (e.g., github.com/user/repo).
    • [CODE]: (Optional) A custom short code for the URL.

    Behavior

    • If the URL does not include a protocol (e.g., https://), the tool automatically prepends https://.
    • If successful, the shortened URL is printed to stdout and copied to the clipboard using pbcopy.
    • The tool only supports github.com or gist.github.com URLs.
  10. Use git-rank-contributors to rank contributors by diff size

    master

    The git-rank-contributors script traces through git logs to rank contributors based on the total size of the diffs they are responsible for. In this calculation, a change (modification) counts twice as much as a plain addition or deletion.

    Note: The output may require manual editing before being used in a CREDITS file, as contributors often use multiple email addresses.

  11. Use the 'a' command to launch the AI client

    master
    The a command is a quick shortcut designed to launch the Claude AI client with specific settings. It executes claude with the --dangerously-skip-permissions flag to bypass permission prompts, allowing for a faster, 'yolo-lfg' style startup experience.
    $ a
  12. Use the git-credit command to credit an author on the latest commit

    master

    The git credit command provides a shortcut to amend the most recent commit with a specific author's name and email address. It uses git commit --amend --author under the hood.

    Arguments:

    • $1: The full name of the author (wrapped in quotes if containing spaces).
    • $2: The email address of the author.
    git credit "Zach Holman" zach@example.com