如何将我所有的Intellij代码样式导出到.editorconfig文件? [英] How to export all my Intellij code styles to a .editorconfig file?

查看:185
本文介绍了如何将我所有的Intellij代码样式导出到.editorconfig文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试为我的项目提供标准的代码样式,并且发现 http://editorconfig.org/,这是一个标准.我非常喜欢它,并且Intellij支持(我们使用Intellij).

I'm trying to have a standard code style for my project, and I have found http://editorconfig.org/, that is a standard for that. I like it very much, and Intellij supports it (we use Intellij).

但是我读了很多书,但是我还没有发现如何将Intellij的所有代码样式导出到.editorconfig文件.我只能将它们导出到仅适用于Intellij的XML.

But I have read a lot and I haven´t found how I can export all my code styles of Intellij to a .editorconfig file. I only can export them to an XML that is only for Intellij.

或者是否有任何网页可以读取Java的所有editorconfig域特定属性?在 editorconfig github Wiki 中,它们只有少数几个.

Or is there any webpage where I can read ALL the editorconfig domain specific properties for Java? In the editorconfig github wiki they only have a few.

推荐答案

转到文件->设置->编辑器->代码样式".在右窗格的底部,有一个用于编辑器配置"选项的区域,该区域现在包括一个导出"按钮.这将仅导出编辑器配置"规范中可用的格式设置选项.

Go to "File->Settings->Editor->Code Style". At the bottom of the right pane there is a section for Editor Config options, which now includes an "Export" button. This will only export formatting options that are available in the Editor Config specification.

要包括IDEA中的高级选项,您将必须在项目中保存IntelliJ特定的文件.

To include advanced options from IDEA you will have to save IntelliJ specific files with the project.

如果要执行此操作而又不保存整个".idea"文件夹和"* .iml"文件,则还可以将IDEA配置导出到xml文件中,并保存在每个人都可以使用的位置. /p>

If you want to do this without saving the entire ".idea" folder and "*.iml" files, you can also export the IDEA configuration to an xml file and save in a place where everyone can get to it.

  1. 在文件->设置->编辑器->代码样式"中.在右窗格的顶部,将有一个方案"字段,其中包含选项下拉列表.
  2. 下拉菜单旁边是一个齿轮/齿轮图像,该图像将扩展为 一些选项,具体取决于您选择的方案.
  3. 您需要的两个选项是导出..."选项和导入方案" 名称所暗示的选项.
  1. In "File->Settings->Editor->Code Style". At the top of the right pane, there will be a "Scheme" field with an dropdown of options.
  2. Next to the dropdown is a cog/gear image that will expand to give some options depending on which scheme you have selected.
  3. The two options you need are the "Export..." option and the "Import Scheme" options which do what their names imply.

这篇关于如何将我所有的Intellij代码样式导出到.editorconfig文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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