views:

426

answers:

3

In Visual Studio (using IDEA key mapping), CTRL-SHIFT-R brings up the Refactor menu.

How do I do the same in IntelliJ ?

+2  A: 

You'll find the main refactoring actions are bound to keys, rather than the entire menu being associated with a keyboard shortcut. The cheatsheet shipped with IntelliJ (Help > Default Keymap Reference) was invaluable when I was trying to get my head around everything that was possible. (Available online too!).

I think you can probably get the refactoring menu in Windows by hitting the Context key (next to the Right Ctrl) and then R whilst your cursor is in the editor window. Not sure if a dedicated binding exists - I'm pretty sure you can't set one.

butterchicken
:(I hate remembering the shortcuts to all the different refactorings - for me, I always liked just having a shortcut to the refactor menu itself.Context Key - R isn't configurable :(
ripper234
Hmm, doesn't Alt-R open the Refactoring menu? I think I use that a lot: Alt-R + X = extract method, Alt-R + N = inline. Besides, you'll quickly learn the direct shortcuts to common refactorings (Shift-F6 for rename etc).
Jonik
You can also hit Control+Shift+A (Search for action) and type the name of the refactoring you want. That way you don't need to remember all the shortcuts and yet get to what you want fairly quickly.
Lyudmil
+1  A: 

Alt+R will pull down the menu. For instance, Alt+R, L will allow you to pull up a method.

joeslice
In Visual Studio, a smaller menu with only the relevant refactorings is displayed - it shows only refactorings that apply to the specific entity the caret is on. Thanks anyway.
ripper234
A: 

The range of refactoring options in IntelliJ is fantastic, right click in your editor and hit 'r' to see the entire menu. You'll soon want to just use the keyboard shortcuts though; some of my favourites are:

  • shift-f6: refactor a method or variable name
  • ctrl-shift-f6: refactor a variable / field type
  • ctrl-alt-m: extract a method
  • ctrl-alt-v: introduce a variable
Fritz Meissner

related questions