idea/clion行注释位置(不在首列,注释就靠近代码块)

进入 Settings -> Code Style -> Java或C/C++ ,在右边选择 “Code Generation” Tab,然后找到 Comment Code 那块,把 Line comment at first column Block comment at first column 去掉前面两个的复选框,这样注释就靠近代码块了。 选上Add a space at comment start就会在代码块前添加一个空格。