Vim - indent and syntax broken after recovery file

I edited the file using vim. I started another vim to edit the same file, he said that /tmp/file.swp comes out, press "R" to restore it. I decided to recover. But after that, syntax highlighting did not work on this file (other files are still in order). I tried: syntax and some commands, but didn't work.

+5
source share
5 answers

You can try to use the following command to indicate the type of type. For example, for file c:

:set filetype=c
+6
source

I just solve it in a simple way.

I find the folder in which ~ / .vim / view / and deletes the entry about the py file that I just restored ...

cd ~/.vim/view && ls -alh | grep filename_1 | awk '{print $9}' | xargs rm

, ... .

:)

+2

vim . , . ( , , python script.)

, , , , . vim views , . , , , . .

, , , : , .. ( , / ..) vim. , , , .

+1

:

" C syntax:
:set ft=c

" Java syntax:
:set ft=java

" Python syntax:
:set ft=py

" ... etc.
0

, , :e %, . bufread *, . , , - , - .

0

All Articles