Vim - indent and syntax highlight broken after recover file

highlight, recover, syntax, vim

Solution

You may try to use the following command to specify the type type. For example for c file:

:set filetype=c

Problem

I was editing a file with vim. I started another vim to edit the same file, it said that the /tmp/file.swp exits, press "R" to recover it. I chose to recover. But after that, syntax highlight didn't work on that file (other files still ok). I tried :syntax on and some commands but not worked.

Original source

Related problems