Skip to content

Extract Variable

pavlospt edited this page Oct 24, 2014 · 1 revision

This is a shortcut to extract a variable without going through the refactoring menu.

This is very useful when you are generating code on the fly as you can avoid typing the variable declaration and go straight to the value. The IDE will then generate the declaration and it will come up with some suggestions on how to name the variable.

Additional tip:

  • If you want to change the declaration type to something more generic (e.g. List instead of ArrayList), you can press Shift+Tab and it will give you a list of valid types.

Shortcut (Menu):

  • Mac: Cmd+Alt+V
  • Windows/Linux: Ctrl+Alt+V

Clone this wiki locally