Why is the word file get highlighted in .py files in the Vim text editor?

Viewed 93

The word "file" in python is not a keyword, but my Vim highlights it as if it were. Can someone suggest a fix and explain this strange behaviour? It keeps messing with me. It bothers me every time I look at it.

Wired syntax highlighting of file

Extra info

I think I use regular Vim—I haven't tinkered with my .vimrc much, certainly not with the syntax highlighting.

1 Answers

Many builtins were removed in the Python 2 to 3 transition. file is one of them. Lots of syntax highlighters still highlight them. Now that Python 2 is no longer supported, maintainers may be willing to remove them from the lists, so you can try opening an issue if it bothers you.

Related