简体   繁体   English

如何在 IntelliJ IDEA 中的某些关键字后自动插入空格?

[英]How to insert a space automatically after certain keywords in IntelliJ IDEA?

I want to insert a space automatically after certain keywords.我想在某些关键字之后自动插入一个空格。 For example when typing:例如输入时:

in<return_key> => int<no_space>

Then I have to type a space to name a variable like so:然后我必须输入一个空格来命名一个变量,如下所示:

int x = ...;

What I want IntelliJ to do is the following:我希望 IntelliJ 做的是:

in<return_key> => int<space>

Now I do not need to type the space to name a variable because the IDE already inserted it automatically.现在我不需要键入空格来命名变量,因为 IDE 已经自动插入了它。

(This behavior is already enabled in if, for, while... ) I want to enable this behavior with primitives , Object types . (此行为已在if、for、while...中启用)我想使用原语Object 类型启用此行为。 How can I do it in IDEA?我怎样才能在 IDEA 中做到这一点?

There's no such setting currently, and automatic space insertion would probably be annoying if you want to type int.class , OuterClass.InnerClass or Util.someMethod() .目前没有这样的设置,如果你想输入int.classOuterClass.InnerClassUtil.someMethod() ,自动插入空格可能会很烦人。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM