Sublime Forum

Change color for comments

#1

Hi
I need to edit color for comments, because its very dark.
I am trying to find files with color sheme in AppData\Roaming\Sublime Text 3
But i cant find any files *sublime-color-scheme
Where it is located?

0 Likes

#2

For such operations, I would recommend the PackageDev package. It allows you to easily perform such operations.
Assuming you have the package installed, just select PackageDev: Edit Current Color Scheme. It should open a split window with your current color scheme on the left & your User version of the color scheme on the right (You cannot edit the left file because it is an installed package resource, you can only edit the right one. The left file serves as a reference).

So, in the right file under the rules array, just add :-

{
	"scope": "comment",
	"foreground": "your_fav_color",
},

Replace your_fav_color with whatever color you want (don’t remove the quotes around it). All the comments should then have changed to the desired color.

Assuming you don’t want to install another package, you can still do it albeit rather painful way.
Steps

  1. Go to Preferences: Settings from the command palette.
  2. Check the color_scheme setting on the right hand file. It’ll be something like Packages/some_package/the_color_scheme_name.sublime-color-scheme
  3. You now have to create a file with the exact same name and extension as the_color_scheme_name.sublime-color-scheme in the User directory.
  4. Once that’s done, paste the following :-
{
	// http://www.sublimetext.com/docs/3/color_schemes.html
	"variables": {
		// "green": "#FF0000",
	},
	"globals": {
		// "foreground": "var(green)",
	},
	"rules": [
    ],
}
  1. In the rules array, fill what I gave above.
  2. You should be good to go.
5 Likes

#3

Thank you very much! Its very usefull.

Is it possible to fix this problem
You see when i made error in json file its strange coloring. When i put cursor into problem line color of text become as color of background

0 Likes