I'm trying to auto-format all files in my solution in vs2010. I've seen there is no built-in option to do it. I've tried to write macro to do it, but I've stucked.
When I iterates any ProjectItem
in my projects, I don't know how to open designable-files in source-code mode, or how to distinguish between sourceable files and icourceable files (such as png-s or such).
Do you have any suggestions?
thanks.
Usage. Click the context (or right-click) menu "Format All Files" on Solution Explorer, you can format all files. The progress is shown in the status bar.
Auto formatting settings in Visual Studio Show activity on this post. Select the text you want to automatically indent. Click menu Edit → Advanced → *Format Selection, or press Ctrl + K , Ctrl + F . Format Selection applies the smart indenting rules for the language in which you are programming to the selected text.
To automatically format the file on save, In Visual Studio Code, press Control + Shift + P or Command + Shift + P (Mac) to open the command palette and type setting and then select Preferences: Open User Settings option. Search for format on save setting and check the checkbox.
Well instead of writing a macro check out a Code Maid (free on visualstudiogallery) has these 2 features:
With a number of options for what CleanUp does
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With