My dotfile repository
I have been wanting, for a long time, to make my dotfiles more managable, especially my zsh dotfiles. I looked at a lot of projects, such as oh-my-zsh, Zack Holman's dotfiles, and Ben Alman's dotfiles.
I liked all of the ideas, and none of the implementations.
The one that best suited my desires was Ben Alman's, so I have based my work off of his.
It's really not very complicated. When dotfiles is run, it does a few things:
- Git is installed if necessary, via APT or Homebrew (which is installed if necessary).
- This repo is cloned into the
~/.dotfiles
directory (or updated if it already exists). - Files in
init
are executed (in alphanumeric order). - Files in
copy
are copied into~/
. - Files in
link
are linked into~/
.
Note:
- Dotfiles named with a comma are installed, with the , replaced with a period (eg: ,zshrc => .zshrc)
- Dotfiles in the dotfiles repo are ignored.
- The
backups
folder only gets created when necessary. Any files in~/
that would have been overwritten bycopy
orlink
get backed up there. - Files in
bin
are executable shell scripts. - Files in
source
get sourced whenever a new shell is opened (in alphanumeric order). - Files in
conf
just sit there. If a config file doesn't need to go in~/
, put it in there. - Files in
lib
, also, just sit there. Mostly used for git submodules. - Files in
caches
are cached files, only used by some scripts. This folder will be created if necessary.
Notes:
- You need to be an administrator (for
sudo
). - You need to have installed XCode Command Line Tools, which are available as a separate, optional (and much smaller) download from XCode.
bash -c "$(curl -fsSL https://raw.github.com/jaqque/dotfiles/master/bin/dotfiles)" && source ~/.zshrc
Notes:
- You need to be an administrator (for
sudo
). - If APT hasn't been updated or upgraded recently, it will probably be a few minutes before you see anything.
sudo apt-get -qq update && sudo apt-get -qq upgrade && sudo apt-get -qq install curl && echo &&
bash -c "$(curl -fsSL https://raw.github.com/jaqque/dotfiles/master/bin/dotfiles)" && source ~/.zshrc
These things will be installed, but only if they aren't already.
- Homebrew
- git
- APT
- git-core
- Yum
- Dnf
- Pacman
- Zypper
Any file in the copy
subdirectory will be copied into ~/
. Any file that needs to be modified with personal information (like .gitconfig which contains an email address and private key) should be copied into ~/
. Because the file you'll be editing is no longer in ~/.dotfiles
, it's less likely to be accidentally committed into your public dotfiles repo.
Any file in the link
subdirectory gets symbolically linked with ln -s
into ~/
. Edit these, and you change the file in the repo. Don't link files containing sensitive data, or you might accidentally commit that data!
To keep things easy, the ~/.zshrc
file is extremely simple, and should never need to be modified. Instead, add your aliases, functions, settings, etc into one of the files in the source
subdirectory, or add a new file. They're all automatically sourced when a new shell is opened.
Copyright (C) 2013 John H. Robinson, IV
Licensed under the MIT license.