博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
在IntelliJ IDEA中配置Google Java Code Style及代码格式化快捷键
阅读量:4659 次
发布时间:2019-06-09

本文共 1048 字,大约阅读时间需要 3 分钟。

google-java-format plugin should intercept the “Reformat Code” action in IDEA (Ctrl+Alt+L) and apply its own rules. However, it does not work with imports for some reason, so to fix that you have to import a Java Google Code Style XML file  to your code style settings in IDEA.

 

1.下载Google Java Code Style在IntelliJ中的配置文件 https://github.com/google/styleguide

2.选择”File”菜单组下的”Settings”菜单项:
3.选择”Editor->Code Style”菜单项,并点击图示的”Intellij IDEA code style XML”导入第1步中下载的配置文件(可修改导入的配置名,此处使用默认的”GoogleStyle”):

4.将当前项目的”Schema:”设置为第3步中导入的”GoogleStyle” 

5.”Editor->Code Style->Java->Imports->Names count to use static import with *”菜单项, 输入1

6.Install google-java-format plugin (File -> Settings -> Plugins -> Browse repositories -> search for “google-java-format” and install)

   After installation, the plugin has to be enabled per-project (it is disabled by default). To do that, open your project and go to File -> Settings -> Other Settings -> google-java-format Settings and check “Enable google-java-format”

 

转载于:https://www.cnblogs.com/tonggc1668/p/9322415.html

你可能感兴趣的文章
移动端单屏解决方案
查看>>
web渗透测试基本步骤
查看>>
使用Struts2标签遍历集合
查看>>
angular.isUndefined()
查看>>
第一次软件工程作业(改进版)
查看>>
网络流24题-飞行员配对方案问题
查看>>
引入css的四种方式
查看>>
iOS开发UI篇—transframe属性(形变)
查看>>
3月7日 ArrayList集合
查看>>
jsp 环境配置记录
查看>>
Python03
查看>>
LOJ 2537 「PKUWC2018」Minimax
查看>>
使用java中replaceAll方法替换字符串中的反斜杠
查看>>
Some configure
查看>>
流量调整和限流技术 【转载】
查看>>
1 线性空间
查看>>
VS不显示最近打开的项目
查看>>
DP(动态规划)
查看>>
chkconfig
查看>>
2.抽取代码(BaseActivity)
查看>>