简体   繁体   English

在 Eclipse 中,如何在默认文本编辑器中更改没有文件扩展名的纯文本文件的前景色和背景色?

[英]In Eclipse, how do you change the foreground and background color in the default text editor for plain text files with no file extension?

In Eclipse for C/C++, how do you change the foreground and background color in the default text editor for plain text files, that is, files with no file extension?在 C/C++ 的 Eclipse 中,对于纯文本文件,即没有文件扩展名的文件,如何在默认文本编辑器中更改前景色和背景色?

I tried going to window > preferences > general > editors > text editors > appearance color options.我试着去 window > 首选项 > 常规 > 编辑器 > 文本编辑器 > 外观颜色选项。 Here it says foreground color and background color, and after hitting 'apply', the color of the text changes briefly, but returns to default as soon as you close the 'preferences' window.这里显示前景色和背景色,点击“应用”后,文本的颜色会短暂改变,但一旦关闭“首选项”window,就会恢复默认值。

The other thing I tried is to set file associations and try to set a different internal editor as the default for plain files.我尝试的另一件事是设置文件关联并尝试将不同的内部编辑器设置为普通文件的默认值。 However it seems to only work for files that have an extension.但是,它似乎仅适用于具有扩展名的文件。

I often have to deal with existing files in a repository that are actually bash scripts, but the files have no extension.我经常需要处理存储库中的现有文件,这些文件实际上是 bash 脚本,但这些文件没有扩展名。 It is annoying then to not even be able to configure the settings of the editor.甚至无法配置编辑器的设置很烦人。 If I can't find a solution for this, it looks like I either have to 'embrace the suck' or use a different editor outside of Eclipse.如果我找不到解决方案,看起来我要么必须“接受烂”,要么使用 Eclipse 之外的其他编辑器。

I'm working on Kubuntu 2020-04 with Eclipse 2020-06 and using the dark theme.我正在使用 Eclipse 2020-06 开发 Kubuntu 2020-04 并使用深色主题。

It looks like the same problem as here , but I couldn't find any satisfying solution.它看起来和这里的问题一样,但我找不到任何令人满意的解决方案。 The problem was reported there on 2020-01-03, so it actually predates my Eclipse version.该问题于 2020 年 1 月 3 日在那里报告,因此它实际上早于我的 Eclipse 版本。

Thanks to @howlger for suggesting to upgrade.感谢@howlger 建议升级。 After upgrading to Eclipse version 2020-12, the first method I mentioned in the question works, that is, going to window > preferences > general > editors > text editors > appearance color options.升级到 Eclipse 版本 2020-12 后,我在问题中提到的第一种方法有效,即转到 window > 首选项 > 常规 > 编辑器 > 文本编辑器 > 外观颜色选项。 Here you can change the foreground color and background color and it will actually stay the color you selected.在这里您可以更改前景色和背景色,它实际上将保持您选择的颜色。

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

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