"Reprint" Vim's E492 Error

Source: Internet
Author: User

Http://www.cnblogs.com/ini_always/archive/2012/03/03/2378554.html

Copy the VIM profile _VIMRC under Windows to your Mac and re-command it to. VIMRC, which is expected to implement a shared profile. But when I started vim, I reported not a editor command: ^m's error.

The essence of Mac OS is UNIX, and *nix's file line break is \ n, but Windows does not want to put \ r \ n as a newline character, so, when the VIM parsing from Windows copy to Mac VIMRC, because of encountering unresolved \ r, so error.

This simple, with Vim's God replacement function to deal with it:

:%S/^M//GC

The G option represents a global substitution, and the C option indicates that each substitution requires confirmation.

Note, however, that the ^m here are special characters and are not entered with the ^ and m two characters, but by two key combinations c-v c-m input (C = ctrl), and of course, ^m can also use \ r.

But strangely, after I have replaced it, I still report this error when I open vim. In Vim, take a closer look at the. vimrc file format or DOS format, and then use the following command to completely convert the file to UNIX format:

: Set Fileformat=unix

Well, save, and then start vim without errors.

"Reprint" Vim's E492 Error

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.