问题1:IntelliJ可以设置为在创建新行时自动缩进代码体吗?
这是我的意思的一个例子:
我有这个方法:
public static void main(String[] args)
{
System.out.println("Hi there.");
}
在输入表达式后按下返回键,我得到了这个:
public static void main(String[] args)
{
System.out.println("Hi there.");
// the new line aligns itself with the braces.
}
我希望这样做:
public static void main(String[] args)
{
System.out.println("Hi there.");
// the new line aligns itself with the preceding line
}
我无法在“设置”下的任何位置找到可以使其成为默认行为的选项。它存在吗?我错过了它还是我在寻找一只独角兽?
问题2:是否有选项可以默认缩进代码体?如果是这样,它在哪里可以找到?
示例:
使用“重新格式化代码...”命令后,我得到了这个:
public static void main(String[] args)
{
System.out.println("Hi there.");
// the code body is realigned with the braces
}
是否可以设置IntelliJ来执行此操作,如果可以,我在哪里可以找到该选项?:
public static void main(String[] args)
{
System.out.println("Hi there.");
// the code body is indented from the braces
}
这是我在“设置”选项中无法找到的另一件事。
任何帮助都会很棒。谢谢你的时间。