Added vim_check to ensure no effort is wasted on read-only files.