Intellij:将项目缩进从4个空格更改为2个空格 [英] Intellij: Change project indent from 4 spaces to 2 spaces

查看:6453
本文介绍了Intellij:将项目缩进从4个空格更改为2个空格的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

目前,我的所有项目文件都缩进了4个空格。我希望将其更改为2个空格,因为我的组织使用2作为标准,但找不到任何答案。

Currently, all of my project files are indented with 4 spaces. I want to change that to 2 spaces as my organization uses 2 as an standard, but can't find any answers.

推荐答案

根据您的IDEA版本,它应该在您的设置下:

编辑器>代码风格> (特定语言)

Depending on your version of IDEA, it should be in your settings under:
Editor > Code Style > (Specific language)

**编辑:示例,在IDEA 2016中:

** Example, in IDEA 2016:

如果你没有在那里看到它,我通过在设置窗口中搜索缩进找到我的。

If you don't see it there, I found mine by searching "indent" in the settings window.

最后,对于组织范围的代码设置,我强烈建议 EditorConfig 。它几乎与每个IDE兼容,并允许您强制执行代码样式设置,而无需每个人手动更改其设置以匹配。 IDEA支持开箱即用,没有插件。

Finally, for organization-wide code settings, I highly recommend EditorConfig. It's compatible with just about every IDE out there and lets you enforce code style settings without requiring everyone to manually change their settings to match. IDEA supports it out of the box, without a plugin.

这篇关于Intellij:将项目缩进从4个空格更改为2个空格的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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