Home Download Buy Blog Forum Support

Scheme colours for line numbers and tab characters?

Scheme colours for line numbers and tab characters?

Postby Fatbat on Mon Mar 19, 2012 2:43 pm

I'm making a variation on the Twilight scheme and I'm trying to figure out how to alter the colour and/or transparency of the indenting tabs/spaces and the line numbers. I can see that they are tied to the general text colour...

<key>foreground</key>
<string>#FFF</string>

and that they are a level of transparency based on that. Is it possible to colour them independently and/or change their transparency? If so, what is the key for them?

Thanks.
Fatbat
 
Posts: 70
Joined: Sun Feb 19, 2012 6:54 pm

Re: Scheme colours for line numbers and tab characters?

Postby Fatbat on Mon Mar 19, 2012 5:59 pm

OK, after much searching I found you can change the line numbers with...

<key>gutterForeground</key>

Now, if I could just figure out how to change the indenting characters.
Fatbat
 
Posts: 70
Joined: Sun Feb 19, 2012 6:54 pm

Re: Scheme colours for line numbers and tab characters?

Postby atomi on Mon Mar 19, 2012 6:58 pm

Good job on posting an update Fatbat.

I've been here for a few months and I haven't seen anyway to change transparency of indentations through settings.
I can suggest checking the Theme - Default folder it might be in there somewhere.
atomi
 
Posts: 342
Joined: Thu Jan 20, 2011 5:06 pm
Location: Los Angeles CA US

Re: Scheme colours for line numbers and tab characters?

Postby Fatbat on Mon Mar 19, 2012 7:16 pm

I found lots of references to "whitespace" while searching but adding...

<key>whitespace</key>
<string>#FF0000</string> << or whatever colour you like

doesn't have any effect :(
Fatbat
 
Posts: 70
Joined: Sun Feb 19, 2012 6:54 pm

Re: Scheme colours for line numbers and tab characters?

Postby facelessuser on Mon Mar 19, 2012 7:30 pm

Option 1: The only way to highlight white space with your color scheme to a particular color is to go through everyone of your syntax languages and scope all white space with a particular scope and then use that scope in your color scheme and highlight the foreground and/or background to your preferences...not very practical.

Option 2: Write a plugin that will automatically highlight all of your white space. Or use an existing plugin that can facilitate your desires.
facelessuser
 
Posts: 1570
Joined: Tue Apr 05, 2011 7:38 pm

Re: Scheme colours for line numbers and tab characters?

Postby nick. on Mon Mar 19, 2012 7:36 pm

I've seen some schemes with
Code: Select all
<key>invisibles</key>

but it doesn't seem to have any effect.

You should be able to create scopes that change the color for whitespace characters. Unfortunately you'll have to do so for each language definition:
Plain text.tmLanguage
Code: Select all
<dict>
   <key>match</key>
   <string>^\t+</string>
   <key>name</key>
   <string>meta.tab</string>
</dict>


Your scheme.tmTheme
Code: Select all
<dict>
   <key>scope</key>
   <string>meta.tab</string>
   <key>settings</key>
   <dict>
      <key>foreground</key>
      <string>#FF0000</string>
   </dict>
      
</dict>


Looks like faceless had the same idea. I agree that it isn't the best way, but it'll work!
nick.
 
Posts: 266
Joined: Wed Jan 18, 2012 3:45 am

Re: Scheme colours for line numbers and tab characters?

Postby Fatbat on Mon Mar 19, 2012 8:10 pm

Hmmm, that looks like a bit of work. I too see the "invisibles" key in my scheme, but it doesn't seem to do anything at all. Maybe something that will get sorted in a future update.
Fatbat
 
Posts: 70
Joined: Sun Feb 19, 2012 6:54 pm

Re: Scheme colours for line numbers and tab characters?

Postby Fatbat on Tue Mar 20, 2012 2:16 pm

I figured it out! If you simply add a transparency to your foreground key all the indentation dims but the main text doesn't. edit: seems to only affect tabs in the whitespace, not spaces.

So in my case I have...

Code: Select all
<key>foreground</key>
<string>#E8E0CE40</string>


and voilà! Indentation is perfect :)

Image
Fatbat
 
Posts: 70
Joined: Sun Feb 19, 2012 6:54 pm

Re: Scheme colours for line numbers and tab characters?

Postby old9 on Fri Oct 26, 2012 3:20 am

Thanks for sharing this Fatbat!
old9
 
Posts: 4
Joined: Fri Mar 23, 2012 2:16 am

Re: Scheme colours for line numbers and tab characters?

Postby Eduan on Fri Oct 26, 2012 12:50 pm

That's awesome Fatbat! Thanks for sharing this. :)
Check out my blog and website: EduanTech.com (currently undergoing some facial and organs makeover...)
Also check out my profiles: GitHub - Greduan | BitBucket - Greduan
Eduan
 
Posts: 140
Joined: Sun Oct 14, 2012 4:05 pm

Next

Return to Technical Support

Who is online

Users browsing this forum: Exabot [Bot], Yahoo [Bot] and 30 guests