Google Code style in eclipse

Source: Internet
Author: User

In Android projects, especially cooperation projects,CodeStyle consistency is particularly important for coding. This article briefly describes how to import Google encoding style files in eclipse. For more information, refer to the official website: idea.

The first step, find the file (some nonsense) in the notebook (don't want to bother, you can also download through csdn: http://download.csdn.net/detail/aomandeshangxiao/5209114)


Run the checkout command.

Step 2: Import

Import method: eclipse-> window-> preferences-> JAVA-> code style-> formatter-> Import select the eclipse-java-google-style.xml file.


Click Apply. OK. In this way, you can select the code for formatting (the default shortcut key is Ctrl + Shift + F) to keep the code style consistent.

The default indent is 2 cells. Generally, it is a four-cell indent. You can modify it in edit:




Indentation and Tab indentation can be modified. This basically works.






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.