Eclipse format custom code style

Source: Internet
Author: User
Eclipse format custom code style

Shift + ctrl + f is to format the current code style

Format the entire project, right-click soruce-formatter

To set the class, the first "{" in the method, in the same row of class name and method name, must be in:
Windows-> prrferences-> java-> code style-> formatter-> edit-> in braces, all settings are set to sameline. to display them in a new row, set them to next line.


Set "Formatter": the built-in Eclipse template cannot be exported. you need to create a new one. Enter the template name and select the file for initialization settings. This part mainly sets the format of the formatted code, including indentation, blank lines, and curly arc. Let's take a look at what you like. Click Export to save the file as a. xml file.

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.