简体   繁体   English

如何在eclipse项目资源管理器中更改已更改文件的背景颜色?

[英]How to change the background color for changed files in eclipse project explorer?

Changed files under version control are displayed with a dark brown background in the project explorer, making the file names unreadable. 版本控制下的已更改文件在项目资源管理器中显示为深棕色背景,使文件名不可读。 I would like to change it. 我想改变它。

棕色

I have switched between several color themes, but they don't affect the colors in the project explorer. 我在几个颜色主题之间切换,但它们不会影响项目资源管理器中的颜色。 I have not found any useful options neither in the General->Appearance->Colors&Fonts menu nor in the Team->Git menu. 我没有在General->Appearance->Colors&Fonts菜单中找到任何有用的选项,也没有在General->Appearance->Colors&Fonts Team->Git菜单中找到任何有用的选项。

The right-click on the colored filename does not offer an option to change color, as it does when used inside the editor. 右键单击彩色文件名不提供更改颜色的选项,就像在编辑器中使用时一样。

I am using eclipse 3.7 SR2 with EGit. 我正在使用带有EGit的eclipse 3.7 SR2。

EDIT: I can confirm that it is the git decorator providing the colors - once I switch it off (General->Appearance->Label decorators), the brown color is gone. 编辑:我可以确认它是提供颜色的git装饰器 - 一旦我关闭它(General-> Appearance-> Label decorators),棕色就消失了。

The settings you want are under Preferences > General > Appearance > Colors and Fonts , look for the section " Git " in the list and under there, "Uncommitted Change (Background)" and "Uncommitted Change (Foreground)." 您需要的设置位于首选项 > 常规 > 外观 > 颜色和字体下 ,在列表中查找“ Git ”部分,然后在“未提交的更改(背景)”和“未提交的更改(前景)”中查找。 在此输入图像描述

I edited those settings to be a light blue background with white foreground and this is what a changed file looks like in my Project/Package Explorers: 我将这些设置编辑为带有白色前景的浅蓝色背景,这是我的项目/包浏览器中更改的文件的样子:

在此输入图像描述

Another similar feature not in project explorer but right inside file is QuickDiff. 项目浏览器中没有的另一个类似功能,但内部文件是QuickDiff。 This is the feature that tells us all the time which line you have changed, added and deleted by always comparing to what's commmited. 这个功能通过始终与提交的内容进行比较,告诉我们您所有时间更改,添加和删除的行。 To enable this do this Window -> Preferences -> Quick Diff -> Enable Quick Diff Window -> Preferences -> Quick Diff -> Use this reference source -> Git Have Revision 要启用此功能,请执行以下窗口 - >首选项 - >快速差异 - >启用快速差异窗口 - >首选项 - >快速差异 - >使用此参考源 - > Git进行修订

Change the color you want to indicate what's changed, added and deleted. 更改您想要的颜色,以指示更改,添加和删除的内容。 I use yellow, green and red respectively. 我分别使用黄色,绿色和红色。 Then, at any time, you are in file it'll always be visible which line you have edited and can hover over the line numbers (which will be colored pink, blue or any color you have selected) to see exactly what you've changed vs Git. 然后,在任何时候,您都在文件中,它始终可见您已编辑的哪条线,并且可以将鼠标悬停在线号上(颜色为粉红色,蓝色或您选择的任何颜色),以确切了解您的情况改变了对Git。 在这里它是如何在eclipse中看起来的

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM