[vim] Add CloseWindowOrKillBuffer function