Shortcut key for refactor

Answered

I don't like to take my hands off they keyboard.

I am wondering is there a shortcut key to get to the refactor menu?  Or at least an option for me to access that menu?

I would like to do stuff like extract method and introduce variable without using my mouse, but not having to assign a keyboard shortcut to each refactor.

2 comments

Hello Mel,

While I don't know of a generic shortcut to bring up the list of possible refactorings, each one has (or can be assigned) a keyboard shortcut in Preferences->Keymap

The specific ones you mention already have shortcuts: command-option-M for Extract Method, and command-option-V for Introduce Variable.

A more generic keyboard shortcut for getting to menu items is to type command-shift-A. That brings up the Find Action popup.
There you can just start typing the command you're looking for and then select it from the list with up/down arrows and hit enter.

0

On Mac, Command-Option-Shift-T will pull up the "Refactor This..." menu (your cursor will need to be on whatever you want to refactor). You can of course change the shortcut in the Preferences under Keymap.

 

Hope that helps,

Frans

2

Please sign in to leave a comment.