tabs in vi

Mitchel Wyle wyle at inf.ethz.ch
Thu Aug 24 18:02:56 AEST 1989


In article <7901 at ardent.UUCP> landay at ardent.com (James A. Landay) writes:
>Is there a way to make it so that when ever I hit the TAB key
>in 'vi' that I get 4 spaces rather than an actual tab?  I would
>rather not have to run expand after running vi, as I would only
>want to do that if I actually changed the file.

>landay at ardent.com

You probably want something more complicated than what you specified.
What you just specified can be done with

map! ^V^I <four spaces>

or abbr instead of map!

What you want is something which will ALIGN columns with spaces, using
tab-stops every 4 spaces.

I use tabs while I'm typing, then pipe the file through expand(1) to 
get spaces before saving or every so often.  I suspect that expand
can take params about how wide tab-stops are, etc.

Any solutions which are more elegant??

-Mitch



More information about the Comp.unix.questions mailing list