Skip to content

Pinjasaur/dotfiles

Repository files navigation

dotfiles

there's no place like $HOME

Setup

This is all inspired & based upon https://developer.atlassian.com/blog/2016/02/best-way-to-store-dotfiles-git-bare-repo/.

From scratch (make sure Bash & Git are up to date first—looking at you macOS defaults 🙄):

  • Go $HOME: cd ~
  • Clone repo:
    • HTTPS: git clone --bare https://github.com/Pinjasaur/dotfiles $HOME/.cfg
    • SSH: git clone --bare [email protected]:Pinjasaur/dotfiles.git $HOME/.cfg
  • Add cfg alias: alias cfg='/usr/bin/git --git-dir=$HOME/.cfg/ --work-tree=$HOME'
  • Make backup directory: mkdir -p .cfg-backup
  • Checkout dotfiles: cfg checkout
    • If conflicts: cfg checkout 2>&1 | egrep "\s+\." | awk {'print $1'} | xargs -I{} mv {} .cfg-backup/{}
    • Re-checkout: cfg checkout
  • Don't show untracked: cfg config status.showUntrackedFiles no
  • Update submodules: cfg submodule update --init --recursive
  • Create .bash.local & .gitconfig.local from here (sorry, they're for my 👀 only)

macOS specifics

  • git may be /usr/local/bin/git, /opt/homebrew/bin/git, etc
  • brew install reattach-to-user-namespace
  • set-option -g default-command "reattach-to-user-namespace -l $SHELL" in .tmux.conf.local

Submodule maintenance

  • Pull in submodule changes: cfg submodule update --init --recursive
  • Update submodules to latest: cfg submodule update --remote --merge
  • Check submodule status: cfg submodule status --recursive

Customizations

Create a .bash.local for setting up any shell-specic settings (aliases, functions, exports, etc.).

There are also local configs for Vim (.vimrc.local) and tmux (.tmux.conf.local) where you can place custom local settings.

Noteworthy

PuTTY

May need to change settings to get 256 colors.

  • PuTTY: Connection > Data > Terminal-type xterm-256color

acknowledgements

Tooling and configuration inspired by:

License

MIT.