IntelliJ IDEA shortcut for Extract/Introduce Local Variable


In IntelliJ IDEA, Ctrl + Alt + V for Windows/Linux and ⌘⌥V for macOS is the shortcut key to extract the highlighted or selected code into a local variable.

Similar Post: Shortcut key for Extract Local Variable in Eclipse/STS

Select the piece of code that you want to introduce a  local variable name or put your mouse pointer at the end of the code,

IntelliJ IDEA shortcut for Extract Local Variable

And press Ctrl + Alt + V (Windows/Linux) or ⌘⌥V (macOS) button together, IntelliJ IDEA automatically assigned a local variable for that code snippet.

IntelliJ IDEA shortcut for Introduce Local Variable

References

  1. IntelliJ IDEA- Import/Open multiple project in single Window
  2. IntelliJ IDEA– Remove/Optimize unused imports shortcut keys
  3. IntelliJ IDEA – Code reformat and rearrange shortcut keys

Similar Posts

About the Author

Atul Rai
I love sharing my experiments and ideas with everyone by writing articles on the latest technological trends. Read all published posts by Atul Rai.