Question

I'm trying to install Syntastic for Vim using Cygwin. After completing step 2.1 and the cloning part of step 2.2 in the installation guide of Syntastic, I find that now when I run vim I get the following errors:

Error detected while processing /home/rjw08/.vim/bundle/syntastic/plugin/syntastic/autoloclist.vim:
line    1:
E15: Invalid expression: exists("g:loaded_syntastic_notifier_autoloclist") || !exists("g:loaded_syntastic_plugin")^M
line   39:
E171: Missing :endif
Error detected while processing /home/rjw08/.vim/bundle/syntastic/plugin/syntastic/balloons.vim:
line    1:
E15: Invalid expression: exists("g:loaded_syntastic_notifier_balloons") || !exists("g:loaded_syntastic_plugin")^M
line   67:
E171: Missing :endif
Error detected while processing /home/rjw08/.vim/bundle/syntastic/plugin/syntastic/checker.vim:
line    1:
E15: Invalid expression: exists("g:loaded_syntastic_checker") || !exists("g:loaded_syntastic_plugin")^M

There were a few more errors, but they follow this basic format. From what I understand, file endings in the listed files are incorrect (i.e. ^M). However when I open these files in Vim, there does not seem to be any ^M endings to delete.

How do I fix this problem?

Was it helpful?

Solution

Load the file into vim, then :set fileformat=unix and :wq should fix it.

PS: you don't see the ^Ms because vim thinks it is a dos file (it probably says [dos] in the status bar after loading).

OTHER TIPS

This command will transform every file to a unix file in the ~/.vim/bundle directory.

find ~/.vim/bundle -type f -follow -print|xargs dos2unix
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top