How can I change a theme to set a background color to the current line in TextMate 2?

9.9k Views Asked by At

In TextMate 1, we could use the Preferences dialog for this. In TextMate 2, at least at this point, I gather we have to use Edit Bundles, and edit the source of a specific theme. But what is the syntax to set a background color to the current line (i.e. the line on which the cursor is)?

3

There are 3 best solutions below

1
On

According to Macromates's Twitter theme editor is not implemented yet.

0
On

While editing the theme files have you looked at this particular setting, just pasting a snippet from a theme I saw it in. (Havent actually tried to see if this works, sorry)

settings = {
    background = '#FFFFFF';
    caret = '#000000';
    foreground = '#000000';
    invisibles = '#BFBFBF';
    lineHighlight = '#FFFBD1';
    selection = '#BDD5FC';
};

I am referring to the lineHighlight option in the settings above.

0
On

Open up the bundle editor and then go to Theme's (or whatever theme you might have picked under View > Theme (Solarized and SubtleGradient have their own bundle).

then it is a simple JSON document for editing your theme.

Edit the "lineHighlight" property and set it to whatever you want your highlighted line to be in HEX.