IntelliJ using--Import the code format file for Eclipse

Source: Internet
Author: User

Catalogue [-]

    • Method
    • To install the plugin:
    • To configure the plugin:
    • Using plugins
    • Test

It is important for a team to use a unified code format, or there will be a lot of conflicts when using the version Control tool. In eclipse, we can use some XML for the unification of code format, but these files should be used in the IntelliJ, still need a little bit of trouble. But if you're like a blogger, having a painful experience of merging a file with 200 conflicts, you'll find the job worthwhile.

Method

Generally we use eclipse to unify the code-style.xml files. IntelliJ cannot import this file directly, but there is a plugin that Eclipse Code Formatter can accomplish this task.

    • To install the plugin:

      Select Preferences=>plugins=>browse repositories, search Eclipse to appear, click Install in the upper left corner Download and Install . After installation, restart IntelliJ to locate the configuration item in Preferences=>eclipse Code formatter.

    • To configure the plugin:

      Select Preferences=>eclipse code Formatter, tick Use the Eclipse-code-formatter , and select the Eclipse Java Formatter config file file for Eclipse code-style.xml , this option determines how the code is formatted. Also configured Import order From File for Eclipse code-style.xml files, this option determines how the import area is organized.

    • Using plugins

      Use the IntelliJ format shortcut "ctrl+shift+f" to format. If an error occurs, the output prompts to the event log, and if you see ' xxx formatted sucessfully by Eclipse code Formatter ' then the format is successful!

      To add a little tip, it is generally recommended that you only format your own code, do not format the full file, select your own block of code, and then use "ctrl+shift+f" to partially format it.

    • Test

      Bloggers are tested in IntelliJ IDEA12 and Eclipse Code Formatter use a code-template.xml with Eclipse 3.5 to edit the same file without a conflict.

IntelliJ using--Import the code format file for Eclipse

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.