http://mchp.us/MPLABTV MPLAB® X has an automatic code formatting feature that can transform code to your liking.