Sublime Forum

Auto italics and changing text colour

#1

Hi,

I’ve had a search around and am struggling to change my text colours to some of the schemes I see out there.
I’ve also seen some people type and it automatically puts some words in italics, I’d like this too but can’t quite find how to.

Link below of how I’d like mine to look, see 4:34

Thanks

https://youtu.be/GmOq1Dc_EIM

0 Likes

#2

What you need are two things:

  1. A syntax definition for the particular language. In the videa GLSL is used, which is available via Package Control.
  2. A color scheme, which sets the italic flag for certain scopes.

The syntax definition is used to tokenize source code and assign a scope to each token. This scope is assigned a color or character style by a color scheme.

The video seems to use Monokai, the former default color scheme of Sublime Text.

The easiest way to edit existing color schemes might be PackageDev. Once installed, you can simply run “Edit Current Color Scheme” to manipulate it just like settings.

The following example shows a simple rule, which marks keywords to be rendered italic.

{
	"rules":
	[
		{
			"scope": "keyword",
			"font_style": "italic",
		},
	]
}
0 Likes

#3

Thanks for your reply, i have absolutely no idea how to do any of that sadly? Could you please help and walk me through what it is i need to do?

Thanks

0 Likes