Sublime Forum

Change color of all lines that start with $

#1

HI–I’m fairly new to Sublime and I’ve been searching for how to do this, but realize I lack even the vocabulary to explain what I’m trying to do.

I want to change the color scheme (currently using Eiffel) so that all lines that begin with $ are colored differently.

Coding in Python right now, so I’m assuming that I’d go into the Eiffel theme file and change what’s under Python…but not sure what to change it to.

Can someone point me to some tutorials that explain how to do this? Or if this is an easy change, tell me what code to change?

Apologies for my newb post. Still trying to grasp the terminology being used and I’m a little overwhelmed.

Any help appreciated. Thank you!

0 Likes

#2

I’m afraid you cannot use different colour schemes in the same view. (maybe I’m wrong, please correct me). One possibility is to use regions to colour/underline portions to highlight these.
For example, paste this in the console

sublime.active_window().active_view().add_regions(‘test’, sublime.active_window().active_view().find_all(r’^^\n]*$^\n]+’), ‘entity.name.function’, ‘dot’, sublime.DRAW_OUTLINED)

to only draw the dot in the gutter and skip the painting of the line, use

sublime.active_window().active_view().add_regions(‘test’, sublime.active_window().active_view().find_all(r’^^\n]*$^\n]+’), ‘entity.name.function’, ‘dot’, sublime.HIDDEN)

to remove the dot just leave the string empty.

0 Likes

#3

Thank you so much for the code. That will do what I need. :smile:

0 Likes