Getting fresh

I just put my dotfiles into github. Well, lets wind back. I want to switch email program because Thunderbird just hangs these days when I try and search my mailbox. I’m thinking about moving back to mutt with notmuch and offlineimap, but that’s a whole other story (which is why those concepts aren’t linked in this entry). There’s a whole lotta setup for those tools; together with my other config files, the time has come to put this stuff into git so I can manage the changes, and access it from work and home. (I have my vim config in Ubuntu One at the moment but that’s only gives me sync, no version history).

Anyways, I spent some time looking into how to set up the necessary links from the git repo to the actual dot files (or the other way round, depending on how you think symlinks work). And got tempted by fresh. Then I found that GitHub themselves recommend it, amongst other tools, for the job. I like the idea of a bundler for shell config — I’m using vundle for Vim. But the docs for fresh don’t actually tell you how the hell it works. Here’s how it works:

  1. Install fresh like they say.
  2. Create a github repro for your dotfiles and clone it into ~/.dotfiles. Fresh does a lot of clever stuff with shell setup: it concatenates shell files into one place where you can source them from bash or zsh. I’m not doing that yet, so:
  3. Put your config files in ./dotfiles, you don’t have to put dot in front (but I think you can if you want). Mine are in ~/.dotfiles/config
  4. Use fresh edit to edit your ~/.freshrc which declares the bundles you want installed
  5. Tell fresh where to find your fiels
fresh config/* --file

Run fresh install and Robert’s your father’s brother.

Oh, and one more thing: fresh edit opens your editor on ~/.freshrc so that’s also a crucial part of your setup. I put mine into .dotfiles and checked it into git. And I manually linked it back to ~/.freshrc. There might be a more elegant way to bootstrap than thisĀ  but I can’t think of it at the moment.

There are more subtle cases for scripts and bash/zsh setup, and its especially good for cherry-picking other people’s config files, if you like that sort of thing. But this is the basic setup for which I had to read the docs and the source code for fresh. Hence this post.

Comments are closed.