VIM C++ Syntax Highlighting: Error detected while processing

Issue

I’m trying to enable advanced syntax highlighting when using VIM on a non-local machine. I’m using the plugin from here: https://github.com/octol/vim-cpp-enhanced-highlight

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?

Solution

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

:%s/^M//g

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.