Select fragment of code and press alt+ctrl+v.
If selected part is an expression and this expression has non-void type, it will be assigned to the new variable.