[Gllug] vi indenting

Alain Williams addw at phcomp.co.uk
Wed Dec 19 09:55:29 UTC 2001


On Wed, Dec 19, 2001 at 09:27:15AM +0000, Nix wrote:
> On Wed, 19 Dec 2001, tet at accucard.com uttered the following:
> > 
> >>> Can anyone tell me how to indent several lines at once with spaces in vi?
> > 
> > Simple answer: don't do it! Indenting is done with tabs, The Way God
> > Intended (tm) :-)
> 
> Do you have any idea how annoying that is when a file is indented by
> people with their tabstop set to different values?

Why have it at anything other than 8 ?

I have always (20 years) indented in C with a tab (width 8). Part of the reason
for this is that it forces me to write readable code; once I have more than 5
nestings ('{' ... '}') the code is moving to the right and there is not that much room
to put a lot of stuff, so time to make a new function.

The result is that my code (IMHO) is readable. I deplore the GNU/Emacs indenting style
& high level of nesting that is often found.

Yes: I do need to occasionally spend some time reorganising code (ie chopping into functions)
and yes, this does take time - but this time is repaid through lower on going maintainance costs.

> See <http://www.jwz.org/doc/tabs-vs-spaces.html>, one of the best
> analyses of the subject I've seen. (Rather Emacs-centric, but given who
> the author is this is perhaps to be expected. Besides, vi can do it
> right, too; turn off the odious optimize and ruthlessly discard
> tabs. :) )
Tabs make things line up neatly & make a file smaller.

-- 
Alain Williams

#include <std_disclaimer.h>

-- 
Gllug mailing list  -  Gllug at linux.co.uk
http://list.ftech.net/mailman/listinfo/gllug




More information about the GLLUG mailing list