Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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.

like image 409
dcxst Avatar asked Sep 20 '25 08:09

dcxst


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.

like image 168
LeopardShark Avatar answered Sep 22 '25 20:09

LeopardShark