Python Function and Variable Font Colors

56 views
Skip to first unread message

Kory Goold

unread,
Feb 8, 2018, 9:05:25 AM2/8/18
to BBEdit Talk
Sorry if this is a repeat post. I've used BBEdit for years, and love it.

I'm teaching myself Python, and the font colors for functions as well as variables are not only set as the same color (regardless of how I adjust them in preference), and they're the same color as whatever I set as the plain text setting.

Is there a way to separate colors for each of these, i.e. one for functions, one for variables, and another for plain text? I had been using the Atom editor, and it got separated nicely. I recently upgraded to v 12 (from 9.x), and was hoping to keep the color scheme I was using with Atom (or at least close to it).

Thanks!

Gregg Thomason

unread,
Feb 12, 2018, 5:14:26 PM2/12/18
to BBEdit Talk
Broadly speaking, BBEdit doesn't color quite as extravagantly as Atom. This is out-of-the-box BBEdit Dark, showing a piece of Python:


def is a language keyword, as is the decorator; and the single string is colored. However BBEdit doesn't know anything about Python _per se_ so it doesn't know that show() is a function name, or list_of_items is a variable. So they're just regular text.

That said: if you do 'bbedit --maketags' on the command line, you get a ctags file created, and now it looks like this:


Which is closer to what you probably want. I don't like ctags coloring most of the time, I think it over-does it on detecting symbols:

 
But to each their own.

Hope that helps,
Reply all
Reply to author
Forward
0 new messages