Set formatter Ctrl + Shift + F for eclipse and myeclipse

Source: Internet
Author: User

In window preferences, Java-> code style-> formatter

In this step, we can find the formatting template Ctrl + Shift + F, which cannot be directly modified here. Because it is the default eclipse template, it is read-only.

We can create a new formatter and click Edit to modify the template.

I modified the template mainly by changing the CTRL + Shift + F and changing my code to multiple lines.

Modify the line wrapping tab in the tab. There is a maximum line with: 80 (default );

Here the default value is 80. We can change it to 120, so that no line breaks will be generated if it does not exceed 120 characters!

You can modify other formats as needed. Of course, you can also export your custom format, which is in XML format. Later in other places

It can also be imported. In this way, no more customization is required.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.