目录 一、设置步骤 一、设置步骤 File | Settings | Tools | Actions on Save 然后点击钩选三个,应用即可 ### 以后在idea退出时候就会自动格式化代码、优化代码以及调整格式