Eclipse Theme - How to change the color of the main editor text

19,034

Solution 1

The lines

StyledText {
    background-color: #383C3E;
    color: #dddddd;
}

in the moonrise-ui-standalone.css file set the colors for the plain text editor. Given the large number of more specific styles in the CSS file this might vary for other editors.

Solution 2

After much searching, I've found a place to change the typing color. It turns out that the color can be changed through the Preferences window:

Eclipse => Window => Preferences => Java => Editor => Syntax Coloring => Element => Java => Others
Share:
19,034
Inversus
Author by

Inversus

A now for something completely different... Python. That is all. :) I'm a Java guy mostly, but I can do all the pretty js/css/html stuff as well, of course, and let's not forget good ol' SQL. Now, it's not that I've got anything against C#. I'm sure it's a very nice language. We've just never really taken the time to get to know each other, ya know? It's like the timing was just never right... His older brother, C++, now that guy's a dude. He's a bit of a pain to work with sometimes, but oh damn does he ever get results! What else? I like reflection.. and stuff like that. It's super cool. It's fascinating to peel back those curtains and see what's inside, eh? Exactly how DO you operate?

Updated on July 20, 2022

Comments

  • Inversus
    Inversus almost 2 years

    To be clear, I am specifically looking for a way to change the text that is produced in the main editor as I am typing it (ie, it is black right now). For lack of a better term, I shall refer to this as 'typing text'. The version of Eclipse that I'm using is Kepler (4.3).

    The equivalent functionality can be achieved in Aptana by visiting:

    Window => Preferences => General => Editors => Text Editors
    

    and changing the Foreground Color

    Now, eclipse actually has this same setting, but it doesn't seem to do anything. It is possible that it is getting overridden by the styles applied through the Moonrise theme, which I found out about elsewhere on StackOverflow and have installed.

    I have determined that a lot of eclipse's fonts/colors/etc can be edited through the Moonrise CSS files, but have not been able to find a style that affects the typing text.

    So I am looking for any way to change the color of this so-called 'typing text' that is likely (but not limited) to be one of the following:

    • A setting in one of eclipse's many locations (See list below)
    • Some MoonRise CSS tweak
    • Some other CSS tweak that works (through MoonRise's CSS, I'd imagine)

    "Why?" You might ask?

    Imagine handwriting with a pen that used molten metal as ink that would dry in various colors as you completed words. That, but for code. Oh yes.


    Editing Moonrise's CSS files:

    Here is Moonrise's page on GitHub

    Or just install it directly through eclipse (as I did):

    https://raw.github.com/guari/eclipse-ui-theme/master/com.github.eclipseuitheme.themes.updatesite
    

    After installing Moonrise, go to:

    Window => Preferences => General => Appearance
    

    and set the Theme to MoonRise (standalone)

    Make a backup copy of, and open in WinRAR (or similar), the following JAR file (obviously, your version number may differ):

    {pathToEclipse}eclipse/plugins/com.github.eclipseuitheme.themes.moonrise-ui_0.8.4.jar
    

    Open the file (inside the jar):

    themes/css/moonrise-ui-standalone.css
    

    Then you can play around thusly:

    1. Edit a CSS rule
    2. Save the file
    3. WinRAR will ask if you want to update the archive
    4. Ensure Eclipse is closed.
    5. Click WinRAR's Yes button.
    6. Open Eclipse
    7. Survey the damage
    8. Rinse, repeat.

    Eclipse Color Locations:

    Since it is a serious pain keeping track of which color is where in the Eclipse Preferences, I made this list of all the sections in which there are color changing options. Note that various plugins and libraries will have their own sections included in Preferences. Obviously, this is not an exhaustive list of those, but I do believe that it's an exhaustive list of the Eclipse ones. Please comment if you know any more not listed (besides some library/plug-in or another).

    • General => Appearance => Colors and Fonts
    • General => Compare/Patch => Text Compare (tab)
    • General => Editors => Structured Text Editors
    • General => Editors => Text Editors
    • General => Editors => Text Editors => Annotations
    • General => Editors => Text Editors => Linked Mode
    • General => Editors => Text Editors => Quick Diff
    • General => Editors => Text Editors => WikiText
    • General => Editors => Text Editors => WikiText => Appearance
    • General => Search
    • Java => Editor
    • Java => Editor => Syntax Coloring
    • Java => Properties Files Editors
    • Mwe2 => Syntax Coloring
    • Plug-in Development => Editors
    • Run/Debug
    • Run/Debug => Console
    • XML => XML Files => Editor => Syntax Coloring
    • Xtend => Syntax Coloring
    • Xtext => Syntax Coloring

    Solution:

    After much searching, I've found a place to change the typing color. It turns out that the color can be changed through the Preferences window:

    Eclipse => Window => Preferences => Java => Editor => Syntax Coloring => Element => Java => Others
    

    Additionally, a big piece of the puzzle that I was missing is the Plug-In Selection Spy which allows for determining the theming information about a specific UI element. It can be viewed by selecting a UI element and pressing ALT+SHIFT+F1

    This was brought to my attention in the answer that was accepted for this information and an explanation of why the Foreground color wasn't being applied.

    I then set out to learn more about this sacred tool and found this great tutorial, which I'll leave here for anyone else who has similar issues in the future.

  • Inversus
    Inversus over 10 years
    Thanks for the response. I tried changing that but it didn't change my text color..
  • greg-449
    greg-449 over 10 years
    @0mnicyde which editor are you trying? This style will just set the default foreground color, any styles applied by the editor will take precedence.
  • Inversus
    Inversus over 10 years
    Is there any way in which I can find out what the id/class of the editor window? Something like how using FireBug on an html document lets you navigate the tree.. As for which editor, I'm using the default eclipse editor
  • Inversus
    Inversus over 10 years
    Even though I've figured out the specific example (see my answer), I'd really like to know if I can do what is described in my previous comment.
  • greg-449
    greg-449 over 10 years
    @0mnicyde There is a different editor for most file types, your answer talks about Java so you are using the Java editor not the basic plain text editor. The Java editor overrides the CSS colors with the colors from its syntax coloring configuration. Press Alt+Shift+F1 in the editor to see the editor plugin details.
  • Inversus
    Inversus over 10 years
    Beautiful. That explains it. Also, the plug-in selection spy is exactly what I need, and have been missing this whole time. Thanks a lot for the help!
  • c14kaa
    c14kaa over 7 years
    Tried with Juno, no luck