The current feature list includes:
- Pad the inside of parentheses with a space. So a(b,c) will become a( b,c )
- Pad the outside of parentheses with a space. So a(b,c) will become a (b,c)
- Pad empty parentheses with a space. So a() will become a( )
- Remove empty parentheses. So a() will become a
- Pad commas. So a(b,c) will become a(b, c)
- Pad operators. So a=b+c will become a = b + c
- Pad inline ifs so a=if(b=1,0,1) will become a=if (b=1,0,1)
- Pad before a line continuation mark (underscore)
- Aid with some common transpositions i.e. endif will become End If
- Comment replacement e.g. ' will become // or vice versa
- Pad comments before and after the comment mark
- Code replacement, a++ (a=a+1), a+=1 (a=a+1), if a!=1 (if a<>1) etc.
- Macros, quickly insert pre-defined text with autocomplete description
- Automatic calculation of windows declare types
Visit https://github.com/JulianSamphire/ReformatCode to download and/or watch the video for more information.
If you have any questions, feature requests or bug reports please post them below.
If something is formatting incorrectly for you, please post what you typed and what you expected to see on separate lines, thanks.
I would only suggest using this in version 2018r1 as there may be some issues with previous versions that have had bug fixes in the latest release. If you would like to know what these are because you'd like to us this on your current version then let me know and I'll dig out the bug reports and let you know what you need to void.