I added a print line to the python script while the script was running, and now all the text is highlighted in red when the file is opened. Opening and closing a file does not get rid of it. Opening the second python file instantly fixed the problem, but then closing the file and reopening returned the problem. Now it will not disappear at all. Does any body know what can cause this?
This happens sometimes in vim when it outputs the syntax to multi-line comments. Sometimes everything after a multi-line comment also becomes the same as the comment.
, vim Python (, python.vim), .
, . , .
''' <== this is the start of a multiline string this is still in the string this is the last line '''
http://vim.wikia.com/wiki/Fix_syntax_highlighting F12 . , <ctrl-l> .
<ctrl-l>
noremap <F12> <Esc>:syntax sync fromstart<CR> inoremap <F12> <C-o>:syntax sync fromstart<CR>
, , .
"/". vim, . , .
, , "/word" - . .
For a quick fix, you can try entering:
:hi Error NONE
And then press Enter.