Change color of __init__ and other predefined items in Pycharm's syntax highlighting

896 Views Asked by At

I'm colorblind and I can barely make out the __init__ when it is on the current line where the caret is, as in this example:

enter image description here

I just can't see it against that highlighted "caret line" background. Same problem for __repr__, __str__, and other such predefined items.

So, I'd like to change their color. How do I do that?

I looked through the color settings (pic below), but I can't figure out which one to change. None of them seem to do what I want.

enter image description here

Yes, I know I could change the color of 'caret row', but that's not a viable alternative, because __init__'s current color also gives me problems in other circumstances.

1

There are 1 best solutions below

0
On BEST ANSWER

In PyCharm you can go to File > Settings...

In the settings panel you can go to Editor > Colors and Fonts and select Python.

Now you are given a code sample where __init__ is probably part of. If you click on the __init__ element, PyCharm will redirect you to an element called "Predefined item definition" which you can set to another color (the "Foreground" element in the right panel):

enter image description here

This is a screenshot of Pycharm Community on Ubuntu. I hope this helps.

Your settings panel seems to have a hierarchical view, based on the panel on the right it is probably located under Identifiers > Predefined symbol.

Changing this will change all predefined elements (like __len__, __class__, etc.) but since you say it is because of color blindness, you want probably to change these as well anyway.