mathiasbynens dotfiles

repository·main·Indexed 12 days ago

https://github.com/mathiasbynens/dotfiles

A collection of customized dotfiles and setup scripts for macOS to automate shell configuration, system defaults, and Homebrew package management.

Tokens
849
Snippets
5
Records
5
Agent score
49%

What's inside mathiasbynens/dotfiles

  1. Set macOS defaults and install Homebrew formulae

    main

    The repository includes scripts to automate macOS setup and Homebrew package installation:

    • ./.macos: Sets sensible macOS system defaults.
    • ./brew.sh: Installs a collection of common Homebrew formulae.

    Note: Some dotfile functionalities (like Bash/Git completion) depend on specific formulae installed by brew.sh. If you choose not to run brew.sh, you must manually install the required dependencies.

    # Set macOS defaults
    ./.macos
    
    # Install Homebrew formulae
    ./brew.sh
  2. Install dotfiles using Git and the bootstrap script

    main

    To install the dotfiles using Git, clone the repository and source the bootstrap.sh script. This script pulls in the latest version and copies the files to your home folder. It is recommended to fork the repository and review the code before installation.

    To update your installation, navigate to your local dotfiles directory and source the script again. You can use a flag to skip the confirmation prompt during updates.

    # Initial installation
    git clone https://github.com/mathiasbynens/dotfiles.git && cd dotfiles && source bootstrap.sh
    
    # To update
    cd dotfiles && source bootstrap.sh
    
    # To update without confirmation prompt
    set -- -f; source bootstrap.sh
  3. Install dotfiles without Git

    main

    If you do not want to use Git, you can install the dotfiles by downloading the tarball from GitHub and extracting it directly into your home directory. This method excludes the README, bootstrap script, macOS specific configs, and the license file.

    cd; curl -#L https://github.com/mathiasbynens/dotfiles/tarball/main | tar -xzv --strip-components 1 --exclude={README.md,bootstrap.sh,.osx,LICENSE-MIT.txt}
  4. Configure the $PATH using ~/.path

    main

    The bootstrap process sources a ~/.path file if it exists. This file is processed before any feature testing (like detecting the ls version) occurs. Use this file to prepend or append directories to your $PATH.

    # Example ~/.path file
    export PATH="/usr/local/bin:$PATH"
  5. Add custom commands or overrides using ~/.extra

    main

    If a ~/.extra file exists in your home directory, it will be sourced along with the other dotfiles. This is the recommended way to:

    • Add custom commands or environment variables (like Git credentials) without forking the entire repository.
    • Add settings you want to keep private.
    • Override existing settings, functions, or aliases provided by the dotfiles.
    # Example ~/.extra file
    GIT_AUTHOR_NAME="Mathias Bynens"
    GIT_COMMITTER_NAME="$GIT_AUTHOR_NAME"
    git config --global user.name "$GIT_AUTHOR_NAME"
    GIT_AUTHOR_EMAIL="mathias@mailinator.com"
    GIT_COMMITTER_EMAIL="$GIT_AUTHOR_EMAIL"
    git config --global user.email "$GIT_AUTHOR_EMAIL"