29

I was able to change all the other SQL syntax coloring in Eclipse Preferences, but the normal (non-Sql-syntactic) text is still black and I couldn't find where to find the setting for that. Black text is kind of hard to read against an almost black background. Thank you!

Steve Waters
  • 3,348
  • 9
  • 54
  • 94

4 Answers4

56

If you are looking for the place to change the Text Editor color settings, go to Preferences->General->Editors->Text Editors, select "Foreground color" in "Appearance color options", uncheck "System Default", click on the color and choose the color you want.

If you want to change the SQL Editor color settings, go to Preferences->Data Management->SQL Development->SQL Editor->Syntax Coloring.

Edit: You need to change the "Others" item in SQL Editor's syntax coloring. It's working on my Mac, anyway. First uncheck "Default foreground color" and then choose the color you want.

Edit: For those not seeing the change, after selecting "Apply and Close", you must Restart your workspace to see the changes. File -> Restart

J.Leupp
  • 233
  • 3
  • 8
Alexis Dufrenoy
  • 11,784
  • 12
  • 82
  • 124
  • That's a good, informative answer, BUT even after changing that, the text remains black. I'm using Eclipse Luna's built-in Dark Theme. – Steve Waters Dec 02 '14 at 14:21
  • When I select that theme, both my SQL editor and my Text editor are still with black font on white background. Is that your problem? (I'm using a Mac) – Alexis Dufrenoy Dec 02 '14 at 14:42
  • Actually yes, with the exception that I've managed to change the background color to dark with some hassle, however the normal text color can't be changed with the same dark magic. – Steve Waters Dec 02 '14 at 14:44
  • Then I don't get it. I was able to change it in the Preferences, like I said in my answer. Which editor are we actually talking about? The text editor or the sql editor? If it is the sql editor, what are you calling "normal text"? – Alexis Dufrenoy Dec 02 '14 at 16:06
  • For example in "CREATE TABLE Person" the word Person is black. Or home_address VARCHAR(255) the word home_address is black. Majority of the text is black. Syntax coloring affects SQL statements such as CREATE TABLE, CONSTRAINT etc. – Steve Waters Dec 03 '14 at 07:37
  • So it's the SQL Editor. Normally, to change the elements you mentioned, you need to change the "Others" item in SQL Editor's syntax coloring. It's working on my Mac, anyway. First uncheck "Default foreground color" and then choose the color you want. – Alexis Dufrenoy Dec 03 '14 at 09:09
  • 1
    Yes, that's it! The settings are kind of confusing. You can edit that to your answer if you will. I'll check it as the correct answer. – Steve Waters Dec 03 '14 at 14:30
  • 1
    The tip to restart finally did it for me – dan carter Mar 30 '20 at 01:18
9

Alexis Dufrenoy is absolutely right:

If you want to change the SQL Editor color settings, go to Preferences->Sata Management->SQL Development->SQL Editor->Syntax Coloring.

Edit: You need to change the "Others" item in SQL Editor's syntax coloring. It's working on my Mac, anyway. First uncheck "Default foreground color" and then choose the color you want.

Just in Luna release I have to restart Eclipse every time after changing SQL syntax coloring (other editors work without restart).

Its strange, but with Windows 7 its the only way.

Community
  • 1
  • 1
and-4
  • 91
  • 1
  • 2
5

I was having trouble with the existing answers on Version: 2019-03 (4.11.0)

Change the color of the "Others" option here to change the black text enter image description here

You may also find it useful to similarly change the other options like "Single Quoted String" (blue default) , "Type" (purple default)

user1821961
  • 588
  • 1
  • 10
  • 18
3

Since 2019-03-14 there is standalone and very simple SQL editor plugin available at eclipse marketplace: https://marketplace.eclipse.org/content/sql-editor - it's just for editing SQL files, syntax highlighting and contains an experimental SQL formatter. It has full customizable colour preferences and also good looking defaults for dark theme - see https://github.com/de-jcup/eclipse-sql-editor/wiki

It is open source, works out of the box, is small and has no dependencies. So it could be a good alternative.

PS: I am the author of the mentioned plugin.

de-jcup
  • 1,402
  • 12
  • 27
  • 1
    @MartijnPieters : I added the disclosure. I do not want to make commercials here, but I had the same questions before I started to write my plugin... So I thought it is okay. – de-jcup Apr 07 '20 at 14:32
  • Sure, within reason. But a recommendation to use a plugin from someone else has *different weight* from the same message coming from the author of the code. You are naturally biased, after all. – Martijn Pieters Apr 07 '20 at 14:35
  • without beeing able to (mark and) execute the code it's not really a good alternative for me. – Andreas Covidiot Aug 22 '22 at 15:21
  • 1
    @AndreasCovidiot: If you need to execute the SQL statements from the IDE you should use DBeaver instead. – de-jcup Aug 23 '22 at 14:57
  • @de-jcup thx - perfect, much more feature-rich than the standard *Database Tools* and an extensive tool also providing nice coloring – Andreas Covidiot Aug 24 '22 at 16:29