0

I am trying to use unicode characters in vim. Since msdos prompt didnt support unicode, I downloaded cygwin.

I added some commands in .vimrc through cygwin. Basic commands like setting encoding, fileencoding to utf8. Since cygwin also doesn't support diacritits or multiple characters. So, to add Tamil character keymappings and abbreviations, I opened notepad.

When I opened the same file through notepad, I got multiple sentences in single line. The new line characters were hidden. when i move to the end of line, that cursor has to be moved twice. So, I manually entered a new line by pressing Enter everytime and saved it. I thought that the fileformat might be wrong and gave :set fileformat+=msdos,unix in vimrc.

Then, I opened cygwin and inside it, opened a file through vim. I am getting an error like E492: Not an editor command : ^M for every line in the vimrc file. I understand that the newline character is causing trouble, but dont know how to solve it. Please help.

2
  • Changing ^M to \n, \r didnt work.
    – SibiCoder
    Jun 5, 2016 at 14:31
  • 1
    fileformat and fileformats are two different options. It doesn't make any sense to set fileformat (without an s) in your .vimrc, and it also doesn't make any sense to set it using += as you do above. Furthermore, msdos is not a valid value for either option. I'd recommend a thorough read-through of all three of the following help sections: :help file-formats, :help 'ff' and :help 'ffs'.
    – Rich
    Dec 14, 2017 at 10:34

1 Answer 1

1

Though Cygwin is installed in Windows, it resembles linux. So, setting the fileformat to unix solves the problem.

:set fileformat=unix

Now, the unicode characters are accepted by Cygwin.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.