How to remove unused imports in Intellij IDEA on c

2020-02-16 07:24发布

Is there a way to remove unused imports in Intellij IDEA on commit?

It is not very optimal to do it manually, CTRL + ALT + O helps but it's still manual.

9条回答
仙女界的扛把子
2楼-- · 2020-02-16 08:17

In Mac IntelliJ IDEA, the command is Cmd + Option + O

For some older versions it is apparently Ctrl + Option + O.

(Letter O not Zero 0) on the latest version 2019.x

查看更多
SAY GOODBYE
3楼-- · 2020-02-16 08:17

Or you can do the following shortcut :

MAC : Shift + Command + A (Enter Action menu pops up)

And write : Optimize Imports

查看更多
爷的心禁止访问
4楼-- · 2020-02-16 08:18

In mac book

IntelliJ

Control + Option + o (not a zero, letter "o")

查看更多
登录 后发表回答