Refactor: .vim extension checking code