Skip to content

benhigham/dotfiles

dotfiles

This repository contains my personal dotfiles - configuration files for various tools and applications.

Install

Set zsh as your login shell:

chsh -s $(which zsh)

Clone this repository to your home directory:

git clone https://github.com/benhigham/dotfiles.git ~/.dotfiles

Usage

GNU Stow (Recommended)

GNU Stow is a symlink farm manager that simplifies dotfile management by automatically creating symlinks based on directory structure.

  1. Install Stow:

    # On macOS
    brew install stow
    
    # On Debian/Ubuntu
    sudo apt-get install stow
    
    # On Fedora
    sudo dnf install stow
  2. Create target directories (optional):

    mkdir -p ~/.config

    This ensures stow will only create symlinks within existing directories rather than symlinking entire directories.

  3. Deploy the dotfiles:

    cd ~/.dotfiles
    stow .

    This will create symlinks from your home directory to the corresponding files in the ~/.dotfiles repository, preserving the same directory structure.

    To stow specific configurations only:

    # Example: only set up `nvim` configuration
    stow .config/nvim
    
    # Example: set up multiple specific configs
    stow .vimrc .config/wezterm .config/git

Manual Symlinks

You can set up these dotfiles using symlinks to point from your home directory to the files in this repository:

# Example for manually linking files
ln -s ~/.dotfiles/.vimrc ~/.vimrc

Requirements

This repository contains configurations for:

Some of the other tools I have configured:

Install Required Tools

On macOS (using Homebrew)

Before using these dotfiles, ensure you have the necessary dependencies installed.

brew install zsh git vim neovim wezterm bat git-delta eza fnm fd fzf lazygit lesspipe starship zoxide

On Linux

Some tools require manual installation or alternative sources on Linux. Check the project links above for more detailed documentation.

Local Configuration

This repository includes the base Git and Zsh configuration, but certain personal information like your email address or machine-specific environment variables should not be committed to version control.

Git: Personal Configuration

To configure the user in Git:

  1. Create a .gitconfig file in the ${HOME} directory:

    touch ~/.gitconfig
  2. Add your personal Git configuration to this file. For example:

    [user]
      name = Your Name
      email = [email protected]
  3. Git will automatically load this configuration alongside the repository's git config.

Zsh: Local Environment Variables

To configure personal or machine-specific environment variables for Zsh:

  1. Create a .zshenv.local file in your Zsh config directory (by default, ~/.config/zsh/):

    mkdir -p ~/.config/zsh
    touch ~/.config/zsh/.zshenv.local
  2. Add your personal environment variables to this file. For example:

    export API_KEY="your-api-key-here"
  3. This file will be automatically sourced by .zshenv if it exists.

Note: The .zshenv.local file is ignored by Git and should not be committed to the repository.

Update

To update your dotfiles repository with the latest changes:

cd ~/.dotfiles
git pull
stow . # Re-stow if new files were added

Uninstall

To remove the symlinks created by stow:

cd ~/.dotfiles
stow -D . # Remove all symlinks

# Or to unstow specific configurations:
stow -D .config/nvim

Customization

Feel free to fork this repository and customize it to your liking. The configurations are meant to be personalized!

License

This project is licensed under the MIT License.

Sponsor this project

 

Contributors 2

  •  
  •