IntelliJ 和 Android Studio 中 Eclipse 的 Ctrl+1
我真的很喜欢 Eclipse 中的 Ctrl+1 快捷方式(错误提示和小型重构)。 IntelliJ 和 Android Studio 中有等效的吗?
I really like the Ctrl+1 shortcut (hints for errors and mini refactorings) in Eclipse. Is there an equivalent for it in IntelliJ and Android Studio?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(6)
尝试按 CTRL + ALT + v。
它将准确地给出该方法的返回类型。
Try pressing CTRL + ALT + v.
It will give the return type exactly of that method.
我认为“其他 -> 显示上下文操作”与 Eclipse 中的 Ctrl+1 非常接近。
I think the "Other -> Show Context Actions" is very close to Ctrl+1 in Eclipse.
Alt+Enter
Alt+Enter
就我个人而言,我认为 AltEnter 不是特别正确。 Ctrl1 执行大量代码生成,例如在给定方法调用的情况下生成局部变量等。
CtrlAlt V ... 生成局部变量
CtrlAltF ... 生成字段
Alt插入 ...生成(下拉菜单生成各种)
现在,与问题无关但可能有帮助,并且在同一个球场上是“foreach” IntelliJ 中的快捷方式是 iter 而不是 for。
Personally I don't think AltEnter is particularly correct. Ctrl1 does lots of code generation like generating local variables given a method call etc.
CtrlAltV ... generates a local variable
CtrlAltF ... generate a field
AltInsert ... generate (drop down menu to generate all sorts)
Now, unrelated to the question but maybe helpful and in the same ball park is that the "foreach" short cut in IntelliJ is iter rather than for.
我也不认为 ctrl+enter 是答案。
我会说 ctrl+alt+shift+t (重构此。 ..) 我重新映射到 ctrl+1 是与 eclipse 中的 ctrl+1 最接近的东西。它允许您内联、提取代码(变量、方法、字段等)、移动代码、拉取成员等。
I also don't think ctrl+enter is the answer.
I'd say ctrl+alt+shift+t (Refactor this...) which I remapped to ctrl+1 is the closest thing to ctrl+1 from eclipse. It allows you to inline, extract code (variable, method, field etc.), move code, pull members etc.
Ctrl + 1 是我最喜欢的快捷键之一,但不幸的是没有完全相同的快捷键。您可以在
文件-->设置-->键盘映射
中搜索快速修复,但什么也找不到。尽管很多人会说 Alt + Enter 是最接近的答案。但我认为有更好的等效项,例如 Ctrl+Alt+Shift+t。它会给你一些神奇的选择。
您还可以通过转到以下位置将其重新映射到 Ctrl + 1:
File-->Settings-->Keymap
Ctrl + 1 was one of my favorite shortcuts but unfortunately there is no exact equivalent shortcut for that. You can search for Quick fix in:
File-->Settings-->Keymap
, but you'll find nothing.Although many people would say Alt + Enter is the nearest answer. but I think there are better equivalents such as Ctrl+Alt+Shift+t. It will give you some magic options.
You can also remap it to Ctrl + 1 by going to:
File-->Settings-->Keymap