Date: Mon, 6 Feb 2012 22:26:08 +0100 From: Ed Schouten <ed@80386.nl> To: hackers@FreeBSD.org Subject: Small tool: fixwhite(1) Message-ID: <20120206212608.GM1860@hoeg.nl>
next in thread | raw e-mail | index | archive | help
--iUV/lbBrmPtUT9dM Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi folks, I just added a small tool to the tools/ directory in src called fixwhite(1) that attempts to fix commonly made whitespace bugs in source files. I wrote it in such a way that it's quite conservative, to make sure it won't make too many annoying changes that you have to roll back manually. It should be useful especially when copy-pasting code between terminals. As mentioned in the commit message, you can just use :%!fixwhite if you're a vi(1) user. Other editors probably support a similar construct. Have fun! --=20 Ed Schouten <ed@80386.nl> WWW: http://80386.nl/ ----- Forwarded message from Ed Schouten <ed@FreeBSD.org> ----- > Date: Mon, 6 Feb 2012 10:23:11 +0000 (UTC) > From: Ed Schouten <ed@FreeBSD.org> > To: src-committers@freebsd.org, svn-src-all@freebsd.org, > svn-src-head@freebsd.org > Subject: svn commit: r231071 - head/tools/tools/fixwhite > > Author: ed > Date: Mon Feb 6 10:23:11 2012 > New Revision: 231071 > URL: http://svn.freebsd.org/changeset/base/231071 > > Log: > Add fixwhite(1). > > This small utility can be used to `sanitize' the whitespace in source > code. It does the following things: > > Global: > - Remove empty lines at the beginning and the end of a file. > - Merge successive empty lines into a single empty line. > > Per-line: > - Remove trailing whitespace. > - Merge spaces preceeding tabs into the tabs. > > It operated on stdin/stdout. This means that if you use vi(1), you can > just run :%!fixwhite to reorganize the file. ----- End forwarded message ----- --iUV/lbBrmPtUT9dM Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (FreeBSD) iQIcBAEBAgAGBQJPMEVvAAoJEG5e2P40kaK7C/UP/3obwMHb3ho+4WOKdmQZc++i YPMN39PhVqUNKyvvpxkyAongacdavJUIrKCNEeIb7/yqiqrmwEfOPQIWOhYZiCM4 O64EQVP+G4fi0VNhIhgSqI8FGd6x7/DTEtGob3g3H4TeODdydPAiTYLKujiGn0ib pvQpf3nv6Pppwxc/fqv1b1ra9677ljmciT5MDvAOdsqtOS7/QntgBM9xf982N/K0 1GgQaeGWLuFLkVyBMF9/vH3zV0gydg0UyABkKzYWOB6qCQueBADqdFXM9mdkb2Ch QS92gctWuFVc7Wc9kV27WWnO0Ni4Y1GuevJfUh8EALyNNezQ9QMDywgkiEXJkw0x pbb8VsX2FKvC2oOHCP7BGB7e3fmCGeLT4OJK0qA+FrHQX8Wxn6Qjmb/s4oYKEwz+ brxLNre9vKDW0KHnMlOlPrBUcs19XCCbCPU15JqkiyVTAa33zIqAiRTPQSrcUSXZ tblRLBQSl1SQAFuGPV5St4WQu8F4lXaVYsGi7RZmkpmWJiuwYoa62RgXtTTueQvT nlL3LFtw/VPi+LbrnOdBjSqdtHB1CovjWuz8JNyMB8fq6MCjbmVnacJhTbpAsum1 AGLpd6nHNLmTXt3olzIVGzdpINgSdFWkOgoax8haWFARZx6uBxfUPSpWPqpqQ75C WuS7NRtBVQ3p4JZ6Cxf7 =buhm -----END PGP SIGNATURE----- --iUV/lbBrmPtUT9dM--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20120206212608.GM1860>