Anders's dotfiles

These are my dotfiles, which may or may not be helpful to you.


There are a number of tools I always seem to end up using. Some of these change over time. Some seem to more or less stay the same. For a while, I preferred MacPorts. These days I prefer Homebrew. Mostly, things stay more or less the same.

You probably want to install these manually before proceeding:

There are a number of other apps which I tend to install. You can have a look at the list and maybe feel inspired.


To set up your local computer just the way I like it, run:
bash <(curl -s

On to the dotfiles

The easiest way to use any one of these is with curl:

cd;curl -O{.whatever}



There are several things going on here:


# Load bash completions
[ -f /usr/local/etc/bash_completion ] && . /usr/local/etc/bash_completion

# TextMate is still my favorite general purpose editor
export EDITOR="mate -w"

Raw .bash_profile



There are a lot of things git can do from the command line which to a large degree render UI tools irellevant. Formatting log output to add color and tree view goes a long way towards that. Also included in this is a set of shortcuts that I have committed to muscle memory since the days when I was using SVN. Added them as aliases in git just made sense.

  name = YOUR_NAME
  excludesfile = ABSOLUTE_PATH_TO_HOME/.gitignore_global
  # Make rebase safe on osx
  rebase = -c core.trustctime=false rebase

  # A couple of shortcuts because I used to use svn
  ci = commit
  co = checkout
  st = status

  # Log, but with tree, colors, and changed files list
  lg = log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --name-status

  # Log, just with tree
  tree = log --graph --oneline --all --color --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit

  # Pull HEAD of master in all submodules
  sp = submodule foreach --recursive git fetch origin --tags && git checkout master && git pull
  # Initialize all submodules
  su = submodule update --init --recursive

  # Clone submodules when cloning a repository
  clone = clone --recurse

  # Words that are too long for me to bother with them
  br = branch
  ch = cherry-pick

  # Rebase local changes on top of anything you pull without nagging about local uncommitted changes
  pr = !git stash && git pull --rebase && git stash pop

  # Fast forward pull - should be the default imho
  pf = pull --ff-only

  # Set upstream when pushing - should be default imho
  pu = push -u

  # Merge without implicitly creating merge commits
  mf = merge --ff-only
  # Delete a remote branch
  bd = push origin --delete

  # Use OSX keychain to remember passwords
  helper = osxkeychain

  # Assume that local branch name matches remote branch name
  default = current

  # Use https for github (obviously)
  protocol = https

Raw .gitconfig



Because we specified it in .gitconfig and because everyone on OSX should ignore .DS_Store files.

# emacs backup file should always be ignored

# OSX folder metadata is everywhere and should always be ignored

# Xcode stores its state in this subfolder, and too many people forget to ignore it

Raw .gitignore_global



Because telnet to a serial device by default doesn't provice the capabilities we are used to in a terminal. This allows us to scroll normally.

termcapinfo xterm* ti@:te@

Raw .screenrc



# Keep connections alive by sending a null packet every 30 seconds
ServerAliveInterval 30
Host wedding
  User wedding
  # Allow editing remote files with rmate
  RemoteForward 52698 localhost:52698
Host magellanic
  User cyborch
  # Allow editing remote files with rmate
  RemoteForward 52698 localhost:52698

Raw .ssh/config