Dec 31, 2015
I have a few machines: personal laptop, work laptop, home linux server, and work linux server. I do development on all of them, and use the same tools most of the time. Syncing dotfiles should be easy, but my requirements include:
A git repository controls versioning just the way I want it. Dropbox syncs, but doesn't deploy/link the files to their locations in the home directory; Mackup syncs and deploys perfectly - it has an option to sync from a local directory and symlink configuration files where you want them. The local directory is a git repository that contains the dotfiles and is mirrored remotely.
To allow for different configurations, my
exports some environment variables to indicate which machine/platform it is:
if hostname | grep -q .WORKDOMAIN.COM; then export ISWORKCOMPUTER=1 else export ISWORKCOMPUTER=0 fi
uname to distinguish between Mac and Linux. It then sources
platform/machine specific bash configurations:
if [ "$(uname)" == "Darwin" ] && [ -f ~/.bash_profile.mac ]; then source ~/.bash_profile.mac fi
.bashrc does the same thing, but checks the variables that were set in
if [ $ISWORKCOMPUTER == 1 ] && [ -f ~/.bashrc.work ]; then source ~/.bashrc.work fi
Vim can also do the same thing:
let iswork=$ISWORK if iswork == '1' if !empty(glob("~/.vimrc.work")) source ~/.vimrc.work endif endif
I like receiving email: firstname.lastname@example.org.
I also like getting followed on Twitter and Facebook. You should do that too.