Intellij Ultimate的Java语法突出显示问题
当我在Intellij Idea Ultimate中运行文件时,我可以获得仅橙色,绿色和灰色的语法突出显示。是否有任何方法可以获得更多的颜色,用于像VSCODE这样的方法和变量的语法突出显示?
这是我的主题,其中一个黑暗主题:
我希望主题就像:
When I run the files in IntelliJ IDEA Ultimate, I can getting improper syntax highlighting of only orange, green, and gray. Is there any way to get more colors for syntax highlighting for methods and variables like VSCode does?
This is my theme with One Dark Theme:
I want the theme to be like:
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
主题
我建议使用 Atom One Dark 作为主题。它真的很丰富多彩,所以更容易集中注意力(至少对我来说)。你应该尝试一下。
重新格式化
有一个关于重新格式化的设置。你应该尝试一下。您可以使用 CTRL+SHIFT+ALT+L 访问它。
Theme
I would suggest using Atom One Dark as a theme. It's really colorful, so it makes easier to focus on (at least for me). You should give it a try.
Reformatting
There is a setting about reformatting. You should try it. You can access it with CTRL+SHIFT+ALT+L.
您可以在 Intellij IDEA 中自定义现有方案的语法着色:
请参阅下面的一些 Java 源代码的语法着色,在颜色自定义之前和之后,显示了诸如深粉色斜体字符串文字、浅蓝色花括号、紫色圆括号、橙色类名称、金色 Java 关键字和浅绿色注释等变化。
默认颜色:
修改后语法着色:
注意:
我所做的丑陋的更改只是为了演示方法,但所需的更改问题屏幕截图中显示的内容应该很容易实现。
为字符串文字选择斜体会产生意想不到的副作用。字符“ᚙ”的显示已更改,因为没有相当于渲染的斜体。
如果你把事情搞砸了,你可以轻松地恢复到默认值。单击方案名称旁边的设置齿轮,然后从弹出菜单中选择恢复默认值:
此方法的一个令人失望的限制是所有 Java 关键字都必须是相同的颜色。这就是为什么导入和包和public和抛出和char和 new 在上面的 Java 源屏幕截图中都具有相同的颜色。
如果您想保留或共享自定义内容,可以将其导出。单击设置齿轮时显示的上下文菜单中选择导出。还有一个导入方案选项。
请参阅 Intellij 中的颜色和字体 IDEA 文档以获取更多信息。
You can customize the syntax coloring of an existing Scheme within Intellij IDEA:
See below for the syntax coloring of some Java source, before and after color customization, showing changes such as dark pink italicized string literals, light blue curly braces, purple round brackets, orange class names, gold Java keywords and light green comments.
Default coloring:
Syntax coloring after modification:
Notes:
The ugly changes I made were just for demonstrating the approach, but the required changes shown in the question's screen shot should be straightforward to achieve.
Selecting italicization for string literals had an unintended side effect. The display of the character 'ᚙ' was changed because there was no italic equivalent to render.
If you mess things up completely, you can easily revert to the defaults. Click the settings cog wheel next to your Scheme name and select Restore Defaults from the popup menu:
A disappointing limitation with this approach is that all Java keywords must be the same color. That's why import and package and public and throws and char and new all have the same color in the Java source screen shot above.
You can export your customization if you want to preserve or share it. Select Export from the context menu shown when you click the settings cog wheel. There is also an Import Scheme option.
See Colors and Fonts in the Intellij IDEA documentation for more information.