to indent according to the GNU rules: int foo (int k) { if (k < 1 || k > 2) { printf ("out of range\n"); printf ("this function requires a value of 1 or 2\n"); } else { printf ("Switching\n"); switch (k) { case 1: printf ("1\n"); break; case 2: printf ("2\n"); break; } } } It produces this output when formatting according to BSD rules: int foo(int k) { if (k < 1 || k > 2) { printf("out of range\n"); printf("this function requires a value of 1 or 2\n"); } else { printf("Switching\n"); switch (k) { case 1: printf("1\n"); break; case 2: printf("2\n"); break; } } } See also Related concepts Elastic tabstop, a feature of many source code editors that detects and maintains aligned indents Minification, making source code compact, even if it becomes harder for humans to understand Obfuscation, deliberately making source code very difficult for humans to understand, even if it becomes somewhat convoluted Utilities enscript, a text-to-PostScript converter, with pretty-printing features References External links Algorithm 268: ALGOL 60 reference language editor William M. McKeeman: Commun. ACM 8(11): 667-668 (1965) lgrind, Comprehensive TEX Archive Network NEATER2: a PL/I source statement reformatter Kenneth Conrow, Ronald G. Smith: Commun. ACM 13(11): 669-675 (1970) SOAP - Simplify Obscure Algol Programs R. S. Scowen, D. Allin, A. L. Hillman, M. Shimell: National Physical Laboratory Central Computer Unit report CCU6 (April, 1969) Includes formatted listing of SOAP source code. SOAP - A Program which Documents and Edits ALGOL 60 Programs. R. S. Scowen, D. Allin, A. L. Hillman, M. Shimell: Comput. J. 14(2): 133-135 (1971) Original SOAP Source Code from the KDF9 (unformatted) SOAP User's Guide. (for Edinburgh IMP) Peter Salkeld Robertson (1976) SOAP Source Code in/for IMP9 Soap80: A Program for Formatting IMP80 Source Programs. J.M. Murison, Edinburgh Regional Computer Center (1980) SOAP Source Code in/for IMP80 E. N. Gregory, University of Kent at Canterbury; Peter D. Stephens, Edinburgh Regional Computer Center PRETTYP.PAS Early pascal prettyprinter. Ledgard et al. Pascal With Style (1979) style(9) FreeBSD style guidelines vgrind, The [Unix] Heirloom Project Formatting your source code GNU style guidelines Articles with example C code Source code Text editor features