There's multiple ways to do this.
Using commands and unit states: (recommended)
-
Reclaim
+ command queue
-
Area reclaim
(+ optional repeat
)
-
Fight
(+ optional repeat
)
-
Patrol
(essentially the same as Fight + repeat)
[Spoiler]Controversial: Among other stupid things devs renamed commands and changed hotkeys. While I cba to adjust, you should still be able to figure everything out by comparing icons and looking at hotkeys ingame. Sorry for the inconvenience.
Using widgets:
-
Auto Reclaim/Heal/Assist (mod)
Sets all idle units that are not selected to fight. That has as effect to reclaim if there is low metal, repair nearby units and assist in building if they have the possibility.
Keep in mind that permanent reclaim commands and the widget can lead to your units suiciding into the enemy. While automatic options for retreating and avoiding enemies exist they are probably not foolproof and can potentially mess up your own orders.
Personally I've had a better experience without the widget - it frequently lead to unexpected behavior. I mostly use area reclaim without repeat and occasionally queue direct reclaim orders to optimize pathing, increase safety or prioritize wreckage that could soon become contested.