首页 > 技术文章 > idea设置单行注释格式(包括配置文件)

ylkh 2019-12-27 11:00 原文

idea中文件单行注释默认在行首位置

 

 

 修改方法:进入File-->Settings-->Editor-->Code Style-->Java,修改Code Generation

 

 

 

 去掉Line comment at first column前的对勾,选中Add a space at comment start,选中第二个是为了让//和注释中间加一个空格,然后点击Apply即可

 

 

配置文件注释:File-->Settings-->Editor-->Code Style-->XML,去掉Line comment at first column前的对勾

 

推荐阅读