What are you using (free) to format your C # code?

Are there any VS.NET plugins that will format the code for printing or emailing and are free as well?

+1


source to share


6 answers


Have you checked the inline formatting provided by VS? Select the code and enter the key chord Ctrl + K, Ctrl + F.



Or go (menu) Edit-> Advanced-> FormatSelection or Edit-> Advanced-> FormatDocument

+5


source


If you copy your code from Visual Studio and paste it into Word, the syntax highlighting is preserved.



Alternatively, you can take a look at the Copy Source As HTML add-in.

+3


source


Is it just a matter of using spaces instead of tabs to indent your code?

+2


source


try Artistic Style 1.22, http://astyle.sourceforge.net/

it is easy to use, has 3 or 4 predefined styles and is customizable.

+1


source


Use some sort of tabs-to-spaces feature, and make sure a font monospaced

(like a typewriter or console) is used for printing or email .

I'm pretty sure VisualStudio has a (slightly well-hidden) feature to convert tab padding to spaces and vice versa.

I usually use vim where you can use:

:set expandtab
:%retab

      

to replace tabs with spaces and:

:set noexpandtab
:%retab

      

to replace spaces with tabs.

Spaces are better for email, etc., because no one can agree on the length (in spaces) of the tab.

0


source


To include tabs in spaces, select code and use Editor -> Advanced -> Untabify Selected Lines

.

0


source







All Articles