0

Is there a shortcut to swap x and y during assignment x = y. For example:

some_object.some_property = another_object.another_property

becomes

another_object.another_property = some_object.some_property
LazyOne
  • 158,824
  • 45
  • 388
  • 391
IamMashed
  • 1,811
  • 2
  • 21
  • 32
  • 3
    There is no built-in action for this. Two plugins that can help here: 1) Shifter plugin -- select lines and invoke Shift+Up action -- it will flip the stuff around `=`. 2) String manipulation plugin -- select lines and invoke Swap Characters/Selections/Lines/Tokens. requires extra step to specify the delimiter symbol (`=` in your case). In both cases -- they will not handle end of statement/element symbols (e.g. `;` or `,`) -- they will treat it as a part of right side statement. There is also "Permute list element/xml attribute" plugin that may do it better but I haven't never used it myself – LazyOne Dec 24 '19 at 17:17
  • What language do you use? – moscas Dec 25 '19 at 10:16
  • i use python....but does it matter? – IamMashed Dec 26 '19 at 12:10

0 Answers0