Quick script to just swap the locations of two components in Pcbnew.
Definitely something that would be cool to see built into the main application, because I find myself need this all the time. Anyway, be the change you want to see in the world, this is what I know how to do to fix the issue.
Select two components, press the toolbar icon, and the position/rotation of the objects will be swapped.
Two outstanding issues:
It won’t do layers/flips yet
The objects get deselected after the operation. This seems to be a weird KiCad behaviour, I guess the code would have to select them again afterwards
PRs welcome, I’m unlikely to come back to this until I need to use it again