Sublime Forum

Is it possible to change the color of comments?

#1

Is it possible to change the color of comments from dull gray to some other color?

Thanks,
Phillip

0 Likes

#2

Yes. Edit your color scheme’s “comment” entry.

0 Likes

#3

@ FichteFoll

Thanks for your comment. I have searched the web - and my Pref’s, for a way to do this, but have not been successful. Can you provide further details as to how this is done?

Thanks!

0 Likes

#4

This works best on ST3.

Step 1: Check which color scheme you are using, and its path.

view.settings().get("color_scheme") in the console
If you use SublimeLinter this will be a different one that what you set initially, so remember the original name.

Step 2: Open it with PackageResourceViewer

packagecontrol.io/packages/Pack … urceViewer

Step 3: Look for the comment entry and change its color

It looks like this (where “scope” is the important key):

        <dict>
            <key>name</key>
            <string>Comment</string>
            <key>scope</key>
            <string>comment</string>
            <key>settings</key>
            <dict>
                <key>foreground</key>
                <string>#747166</string>
            </dict>
        </dict>

Step 4: Save.

Step 5 (if you use SublimeLinter): Set your “modified original” color scheme again.

0 Likes

#5

@ FichteFoll

Thanks so much for your detailed instructions. I will report back later with my results.

Thanks again.

0 Likes

#6

how to do the step2 ?

0 Likes

#7

how to do the step2 ?

If not yet done, first of all you need to install Package Control - the package manager for Sublime Text. You can do so via Menu > Tools > Install Package Control …

Then restart ST and open the command pallet and search for “Package Control: Install Package”. Run that command and search for “PackageResourceViewer”.

Btw.: Most packages provide info about how to install.

With PackageResourceViewer installed, you get further commands in the command pallet like PackageResourceViewer: Extract Package to extract resources from existing packages.

Alternative

If you use ST3176 (3.1) you can use, the builtin command View Package Resource to view files from packages. As those are opened read-only you’ll need to copy the content to a new file within the Packages/User package.

0 Likes