Welcome to my dotfiles repository! This repository contains configuration files and scripts tailored to my preferences, allowing me to maintain a consistent environment across different machines.
This repo uses Chezmoi (Github) which is a dotfile manager that helps users manage their configuration files (dotfiles) across different machines. It allows you to version control your configuration files, synchronize them across multiple devices, and easily apply changes.
- dot_emacs.d: Emacs configuration files and settings.
- dot_gitconfig.tmpl: Git configuration file template.
- dot_gitignore_global: Global Git ignore rules.
- dot_zshrc: Zsh configuration file.
- private_dot_config: Directory for private configuration files.
- private_Library: Directory for private scripts or tools.
- run_onchange_darwin-install-packages.sh.tmpl: Template script for installing packages on macOS.
-
There is 2 ways to install this
- Bootstrap automatically:
sh -c "$(curl -fsLS get.chezmoi.io)" -- init --apply kevynb
- Clone the Repository and install manually:
git clone https://github.com/kevynb/dotfiles cd dotfiles chezmoi init --apply kevynb
-
Customization:
- Adjust configurations in individual dotfiles.
- Add private configurations to the
private_dot_config
directory.
-
Synchronize Changes:
chezmoi cd git add -A git commit -m "My changes" git push
This dotfiles repository serves the following purposes:
-
Configuration Management: Maintain a version-controlled history of personalized configurations for various tools and applications.
-
Portability: Easily replicate the same development environment across different machines.
-
Consistency: Ensure a consistent and efficient workflow by centralizing and managing configuration files.
- Add a new configuration file to chezmoi and track it:
chezmoi add ~/.config/newfile
- Create a new template file in chezmoi for dynamic configuration:
chezmoi add --template ~/.gitconfig
- To edit a configuration file, simply open it using chezmoi. For example, to edit the Zsh configuration:
chezmoi ~/.zshrc
- Check for differences between your local configuration and the tracked version using:
chezmoi diff
- After editing, apply the changes to your dotfiles repository:
chezmoi apply
- Fetch the latest changes from the dotfiles repository and apply them:
chezmoi update
- Pull the latest changes from your repo and see what would change, without actually applying the changes
chezmoi git pull -- --autostash --rebase && chezmoi diff
- Temporarily ignore local changes to a specific file:
chezmoi forget ~/.zshrc
If you need to have machine-specific configuration, you can add variables in .chezmoi.toml.tmpl
.
They will then be used in your templated files.
If you use the special keyword promptStringOnce
you will be prompted what value to use when initializing the repo for the first time.
If you want to update it in the future, run chezmoi init
again or edit ~/.local/share/chezmoi/.chezmoi.toml.tmpl
.
The script run_onchange_darwin-install-packages.sh.tmpl
will load the list of packages in .chezmoidata/packages.yaml
and install all packages listed there.