Nice stuff adopted from Damian Conway's "instantly better vim"