How to change the background color for the line number column in eclipse?
Asked Answered
M

2

11

I am using Eclipse 3.6.1 classic and trying to tweak the color syntax to my desire. The one thing I haven't been able to change is the background color for the line number column. If this is not possible because Eclipse doesn't have an option for it, I will be satisfied even with a hack/plugin if any of you know of any.

Thanks.

Metaphysics answered 24/10, 2010 at 16:39 Comment(2)
Are you saying that you want the line number column background to be different from the text editor background? I don't think that's possible, and I am not aware of any easy hack around that.Breaux
Not an answer, but related: If Preferences → General → Editors → Text Editors → Quick Diff is enabled, its colors for changes and additions will take precedence over the generic background for those lines. (So as a workaround, use a code formatter to change all lines. ;-) As @Iceberg said, the color for unchanged lines should equal the configured editor color; but for me it didn't (probably a bug after switching themes); disabling and re-enabling quick diff fixed it.Pika
C
5

There is not an explicit setting for changing the background color of the line number column (Eclipse Helios, SR2, Build id: 20110218-0911). However, there are work-arounds and here is one:

The line number background changes color according to any changes you make in the Text Editors "Background color" - so the two are the same. Between these two is the column holding the debugging breakpoints (not sure what that column is called) and it's background color is not affected when changing the general background.

I run Eclipse on Linux (Oracle's version) and access it with XMing X-server from a PC. Setting this background color to a very pale yellow makes the narrow column holding the debugging breakpoints standout - and that column is between the text and the line number column. So the effect is to make the boundaries of the line number column more clear. The very pale yellow is #FCFFC8 = RGB 252,255,200 = HSV 63,22,100

Eclipse often behaves a little differently when I run it straight from my PC so this behavior may be one of those cases.

Hope this helps.

Clearcole answered 24/8, 2011 at 19:38 Comment(1)
UPDATE: I see that now the white column I described is the pale yellow also. So - that doesn't work either. I wonder why, with all the thousands of settings available in eclipse, this one was not done.Clearcole
F
3

Go to Preferences -> General -> Editors -> Text Editors -> Appearance color options and you will see that you can set the color of the line numbers using Line number foreground option and you can set the background of the line numbers column using Background color option.

Franky answered 30/4, 2021 at 6:56 Comment(1)
this "background color" option will change background of editor but we need to change background color of column with line numbers onlyPester

© 2022 - 2024 — McMap. All rights reserved.