Dotfile Maintenance

Here is a party I’m a bit late in joining. And it is one of those ideas that makes you smack your head wondering why you didn’t think of it.

Config file tweaks

For years, I’ve maintained a tar.Z bundle that contains a .profile, .cshrc, .bashrc, .vimrc etc. You can tell how old it is by the fact that I still maintain it with compress rather than gzip. When I started it, gzip did not exist. And even after it did, I could not be sure that a system would have it installed. There are a few zillion copies of it lying around on various drives and removable media. Needless to say, each one is slightly different and it may be hard to figure out which is the “latest”.

But with the advent of github, why not use that to store and version control those files?

Github has a nice round up of various systems to do just that.

The idea is rather simple. The “actual” dotfiles live in a git repository that can be cloned and updated. What lives in your home directory is a symlink.

It can get fancier with some of the frameworks allowing you store the files as fragments that get built into a single unit. That allows you to group all the settings for e.g. fzf in one place rather than having to go hunt them down in all the various place they might reside (.vimrc, .bash_profile, etc).

Or, if you don’t like all the symlinking, you can make your entire home directory the repository.

Note that you might still need need to render the repository down to a tarball to get it on a system if the company admin does not allow connection to github – a not unusual security stance to take, mostly to keep things from moving from the system to github.

Getting Started

For something simple to get your feet wet, I would suggest Jeff Coffler’s skeleton.

Jeff has organized things by system (*nix/Win/Mac) and then by subsystem (bash, git, vim), though that second level can actually be organized anyway you want.

Fork his repository into one of your own, clone it to your system. Copy your original dotfiles into the working directory (remember to rename them to remove the dot) and run the Commit; push; you’re done.

One particular file to watch out for is nix/git/gitconfig. It has Jeff’s name and email and some other stuff that you will probably not want. So, be sure to copy your config over top.

Dot directories

Edit: This fix has been added to the upstream version now.

There is a minor flaw in the script that makes it play rough if you have a dot directory (e.g. .vim) that is a symlink. The script will delete the symlink as “stale” since it assumes all such dot things should be files. You can grab the version from my dotfiles as a fix. I will be working to get Jeff to make the change in his copy as well.

Vim packages as submodules

This is a good tutorial on how to manage you vim packages as submodules of your dotfiles repo. I really don’t have anything to add. I am using this method to handle NERDtree and lightline

Dairying in Mongolia

This will be a bit off from the normal fodder for this blog, but I thought it was interesting.

Lets start with a bit of biology.

Babies naturally produce an enzyme called lactase that allows them to digest the main sugar component of milk – lactose. Many (globally it would be most) people lose that ability near puberty. This leads to lactose intolerance and the GI issues it can cause. Many people of European heritage, however, are lactase persistent and maintain the ability to digest lactose – to the delight of the dairy industry.

The standard story in archaeology about dairy husbandry is that lactase persistence will naturally follow along the path of the spread of dairy farming. After all, it would be a great advantage to be able to consume the additional calories and proteins – as an adult – that milk and other dairy products represent. So those that are lactase persistent would be better able to spread their genes and the trait would come to dominate the population.

And when we look at the spread of dairy animals in the Africa and the Levant, that is pretty much what we see.

And then, there are the Mongols.

According to this article from HeritageDaily, the Mongols have been drinking milk as adults for 3,000 years without gaining a majority of lactase persistence in the population.

So, the question is, why?

Has there been continuous influxes of people that are not lactase persistent – essentially swamping any shifts in allele frequency? Have they come up with some other genetic variant that mutes the normal response to lactose?

Hopefully somebody will look into that.