Stealing a bunch of vim stuff from @jdlehman