如何定制Eclipse的文本编辑器代码格式 [英] How to customize Eclipse's text editor code formatting

查看:215
本文介绍了如何定制Eclipse的文本编辑器代码格式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何设置Eclipse的代码格式化程序以允许长度超过80个字符的代码行。我知道很长的行很难阅读,但在我看来,每行80个字符对于宽屏显示器而言是非常小的值。

How can I set my Eclipse's code formatter to allow code rows longer than 80 characters. I know that very long lines is hard to read but in my opinion 80 characters per line is very small value for wide screen monitors.

推荐答案

p>在首选项中,转到 Java > 代码样式> 格式化程序,然后编辑/创建格式化程序,然后转到标签行换行。您可以在最大线宽中设置

In Preferences, go to Java > Code Style > Formatter and edit/create the formatter and go to tab Line Wrapping. There in you can set the Maximum line width.

您还可以在常规> 编辑器> 文本编辑器还设置了打印边距列,这应该将该边距(代码右侧的1px宽的垂直线)移动到所需的位置。然而,这并不影响格式化程序,只影响人眼。

Further on you can in General > Editors > Text Editors also set the Print margin column which should shift up that margin (a 1px wide vertical line in the right side of your code) to the desired position. This however doesn't affect the formatter, only the human eye.

这篇关于如何定制Eclipse的文本编辑器代码格式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆