Eclipse's Ctrl+1 in IntelliJ and Android Studio

EclipseAndroid StudioIntellij Idea

Eclipse Problem Overview


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?

Eclipse Solutions


Solution 1 - Eclipse

Alt+Enter

Solution 2 - Eclipse

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.

Solution 3 - Eclipse

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.

Solution 4 - Eclipse

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

enter image description here

Solution 5 - Eclipse

Try pressing CTRL + ALT + v.

It will give the return type exactly of that method.

Solution 6 - Eclipse

I think the "Other -> Show Context Actions" is very close to Ctrl+1 in Eclipse.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionAndreas KöberleView Question on Stackoverflow
Solution 1 - EclipseCrazyCoderView Answer on Stackoverflow
Solution 2 - EclipseRob BygraveView Answer on Stackoverflow
Solution 3 - EclipseziraelView Answer on Stackoverflow
Solution 4 - EclipseMilad FaridniaView Answer on Stackoverflow
Solution 5 - EclipseMadhavaView Answer on Stackoverflow
Solution 6 - EclipsePaweł SView Answer on Stackoverflow