Skip to content

peinan/dotfiles

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

242 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

dotfiles

Peinan's collection of configuration files for setting up a development environment.

What's Included

Quick Start

Caution

This dotfiles is designed for macOS.

# The easiest way
curl -fsSL https://dotfiles.peinan.cc/install | bash
# or
wget -qO- https://dotfiles.peinan.cc/install | bash
# or via GitHub
curl -fsSL https://raw.githubusercontent.com/peinan/dotfiles/HEAD/scripts/install.sh | bash

# or you can install stow and setup step-by-step by yourself
brew install stow
git clone --recursive https://github.com/peinan/dotfiles && cd dotfiles
brew bundle install
stow -v -t ~ src

Usage

This repository uses GNU Stow to manage symlinks. All configuration files are located in the src/ directory, which mirrors the structure of the home directory.

Directory Structure

We use an "All-in-One" package strategy. The src/ directory is treated as a single package that maps directly to $HOME.

dotfiles/
├── src/                <-- Maps to $HOME
│   ├── .zshrc          <-- Links to ~/.zshrc
│   ├── .gitconfig      <-- Links to ~/.gitconfig
│   └── .config/        <-- Links to ~/.config/
│       ├── nvim/       <-- Links to ~/.config/nvim (Directory link)
│       └── gh/         <-- Links to ~/.config/gh
├── scripts/            <-- Setup scripts (Not stowed)
└── Brewfile            <-- Homebrew bundle (Not stowed)

Workflow

How to add a new config file

  1. Move the file from your home directory to the src directory (maintaining the structure).
  2. Run stow again to create the link.
# Example: Adding .tmux.conf
mv ~/.tmux.conf src/
stow -v -t ~ src

How to edit configurations

Since they are symlinked, you can edit the files in your home directory directly. The changes will be reflected in the repository.

vim ~/.zshrc
# Changes are automatically applied to src/.zshrc

Advanced Usage: Handling Submodules (e.g., Neovim)

Directories that are Git submodules (like src/.config/nvim) are linked as a single directory symlink. For this to work cleanly, ensure the target directory (e.g., ~/.config/nvim) does not exist before running stow.

Advanced Usage: Ignoring Files

Files listed in src/.stow-local-ignore are excluded from symlinking. (e.g., Brewfile, README.md, .DS_Store)

Advanced Usage: Check Link Status

To verify which files are managed by stow:

ls -la ~ | grep "dotfiles/src"
# Output example:
# .zshrc -> .../dotfiles/src/.zshrc

For detailed installation instructions, see the documentation site.

Activities

Alt

License

This repository is licensed under the MIT License - see the LICENSE file for details.

About

A collection of configuration files for setting up a development environment.

Topics

Resources

License

Stars

Watchers

Forks

Contributors