Amended vim function