Skip to content

Repository files navigation

dotfiles

0. Prerequisites

macOS

Install XCode Command-Line Tools.

xcode-select --install

Generate SSH Key and add it to GitHub.

Linux (WSL)

Ensure build tools and curl/git are available.

sudo apt-get update -y
sudo apt-get install -y build-essential ca-certificates curl git

1. Git Clone

Clone this repository into ~/dotfiles

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

2. Deploy dotfiles

# Do not override existing dotfiles
bash ~/dotfiles/setup.sh deploy

# Force override existing dotfiles
bash ~/dotfiles/setup.sh -f deploy

3. Install

bash ~/dotfiles/setup.sh initialize

4. Configure Git user emails

This dotfiles setup expects the following include files referenced from ~/.gitconfig.

  • ~/.gitconfig.user (private GitHub account)
  • ~/.gitconfig.mf-user (work account for github.com/moneyforward)

Create them like this:

cat > ~/.gitconfig.user <<'EOF'
[user]
  name = your.name
  email = your.private@example.com
EOF

cat > ~/.gitconfig.mf-user <<'EOF'
[user]
  name = your.name
  email = your.work@moneyforward
EOF

5. Configure local / secret environment variables

Secrets must never be committed to this repository. The shell rc files source a set of optional files from $HOME instead — if a file is absent it is silently skipped, so nothing breaks on a fresh machine.

Shell Single file Split per purpose
zsh / bash ~/.shrc.local ~/.config/shell/conf.d/*.sh
fish ~/.config/fish/local.fish ~/.config/fish/conf.d/*.fish

~/.shrc.local and ~/.config/shell/conf.d/*.sh are read by both .zshrc and .bashrc, so keep them POSIX sh compatible. Files in a conf.d directory are sourced in lexical order; prefix them with a number (10-aws.sh) to control it.

Start with the single file and move to conf.d only once entries pile up:

touch ~/.shrc.local
chmod 600 ~/.shrc.local
cat >> ~/.shrc.local <<'EOF'
export SECRET_VALUE=hogehoge
EOF

fish uses a different syntax, so it needs its own file:

mkdir -p ~/.config/fish
touch ~/.config/fish/local.fish
chmod 600 ~/.config/fish/local.fish
echo 'set -gx SECRET_VALUE hogehoge' >> ~/.config/fish/local.fish

Two ordering notes:

  • For zsh and bash these files are sourced last, so they can override anything the tracked rc files set (PATH, aliases, and so on).
  • fish auto-sources conf.d/*.fish before config.fish. Put a value in local.fish instead when it has to win over config.fish.

Keep these files under $HOME and outside ~/dotfiles. .gitignore also lists their names as a safety net, and the gitleaks pre-commit hook is a second one.

6. Install Fonts

Powerline Fonts

7. Update dotfiles

brew bundle dump -f

About

dotfiles

Resources

Stars

5 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages