Add vim plugin and fix some corner cases.