Sublime Forum

inverse_caret_state foreground colour


I’ve been trying to get a block cursor to display in Sublime, and have found that if I set inverse_caret_state to true in my settings file, I get the block cursor that is available in the Vintage plugin.

In my thTheme file I have set my caret and selection keys to the same colour as each other, which takes care of the actual block colour for me.

However I was wondering if there is a way to set the colour of the text that the block cursor is currently on.
For example I want my block to be a bright colour, but want to set the text inside the block to be black.

Is there a key I can use to style this?


Dev Build 3118

I just want to bump this once to add a screenshot and ask more simply, is this even possible in ST3 at the moment?

What I have so far is this:

As you can see the block cursor appears behind the characters just fine, but ideally I would like to style the text on top of the cursor to be black.

Is there a syntax theme key or something that would allow me to do this?
(To get the current results I have set the selection and caret keys in my syntax theme with the inverse_caret_state setting enabled to use the Vintage plugin’s block cursor)



Use the selectionForeground key in your tmTheme file.

Check out this post for a few other selection related keys.




Thank you @fico for the suggestion.

Unfortunately it doesn’t seem to affect my theme in the way that I had hoped.

I have the following keys set with relation to selections and carets:


The selectionForeground key does work when I click and drag to select some text:

But if I do not select some text the block cursor still only shows the original foreground colour:

I’m starting to think that it is impossible to set the foreground colour of the block cursor in ST3 at this time.



Here is a gif to show a bit better what I mean is happening now:

As you can see the black foreground only comes into effect when I actually select some text.

So the block cursor uses the selection and caret keys for it’s own colour, but ignores the selectionForeground key when the block cursor blinks on.


Interface Suggestions

There’s no way that I know of to get what you want and it’s been asked for before many times over the years. In my case I’d prefer the underlying character being coloured in XOR to the block cursor, which would work nicely with a phasing block. In addition to a ‘proper’ block caret type, I’d very much like to see either ‘character colour when covered by caret’ or ‘xor block caret’ options.


1 Like


Thanks, @Fico. I have been wondering for some time how to make the selection area in my editor contrast better with the background. The selection area was charcoal over black in my dark EightLime theme. Now it is mustard, thanks to your advice,

1 Like


It’s too bad that the request has gone ignored for so many years.

A ‘proper’ block caret would be nice, instead of having to use the strange inverse_caret_state option, but I suppose at least we can get something that isn’t just a line cursor.
I like the XOR idea too now that you mention it too.

I hope some day it will be implemented.