VIM C++ Syntax Highlighting: Error detected while processing


I’m trying to enable advanced syntax highlighting when using VIM on a non-local machine. I’m using the plugin from here:

I created the directory /.vim/after/syntax/ and moved the cpp.vim file into it. When I open a .cpp file it gives me the following error:

vim error

What should I do?


Your file has DOS line endings. In order to get rid of them open your file and run following command:


where ^M you will get by pressing Ctrl+v Ctrl+m. This way you should get rid of wrong line endings.
Or just use :set ff=unix as you wrote.

There is also another option. You can also configure git to not convert line endings dealing with line endings

Answered By – Marek Vitek

Answer Checked By – Senaida (AngularFixing Volunteer)

Leave a Reply

Your email address will not be published.