[Gllug] vi indenting

Alex Hudson home at alexhudson.com
Wed Dec 19 14:31:54 UTC 2001


On Wed, 2001-12-19 at 13:48, Paul Brazier wrote:
> One place tabs fall down I've found is when using it for tabular data -
> because you can't set your tab stops separately for each text file you
> end up using muliple tabs just to line a column up.

... although, if they didn't line up it would be a valid tab-separated
file, for the most part :)

What you're asking for, though, is tab-stops rather than tabs, and
spaces don't solve the problem either - if you need to insert something
which is wider than an existing column, you have to go through and move
other items across.

> Maybe what might be useful is a standard way of encoding tab stop
> details into the top of a text file e.g. something like:
> #!tabstops 8,12,16,18,20

You can do this per editor (at least; emacs will allow this). It's a
shame there's not a real standard for it.

> But I suppose the thing about text files is they don't include this sort
> of metadata otherwise they become word processing documents.

They are word processing documents - presentation of code is extremely
important. Humans have to read it too :) The ability of basic
word-processing features (edits, versioning, etc.) would be a boon in
source code, but people generally like to encode this outside of a file.

> Also what if you wanted different tab stops for different sections of
> the file?

Then you know you need to go and see a doctor :)

Seriously, formatting must be one thing above all else: consistent.
Having large sections of different formatting is very bad if you want to
maintain something (although, local rule-breaks are occasionally a good
thing too).

> Is it correct that using spaces is identical to using tabs with the
> width set to 1?

No. Tabs insert a different ASCII code - 9 instead of 20. Some heinous
editors allow you to modify tab to issue spaces, but that is definitely
wrong :)

Cheers,

Alex.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 240 bytes
Desc: not available
URL: <http://mailman.lug.org.uk/pipermail/gllug/attachments/20011219/028fdba3/attachment.pgp>


More information about the GLLUG mailing list