Vi and tabs (RTFM?)

Guangliang He ghe at nucthy.physics.orst.edu
Wed Jun 21 17:14:09 AEST 1989


In article <2852 at helios.ee.lbl.gov> envbvs at epb2.lbl.gov (Brian V. Smith) writes:
=In article <4732 at alvin.mcnc.org>, spl at mcnc.org (Steve Lamont) writes:
=
=> What is the magic set of incantations to stop vi from inserting
=> gratutious (at least from my perspective) tabs in text while doing
=> autoindent?  F'rinstance if I type something like
=> 
=> 	function( parameter1,
=> 		  parameter2,
=> 		  parameter3 );
=> 
=> vi very 'helpfully' will stick a tab and some spaces before the string
=> 'parameter3.'  I would prefer spaces (humor me :-) ).
=> 
=> As they say on the radio talk shows, "I'll take my answer on the air."
=> That is, email will do just fine.
=
=I just happened to be looking in the newsgroup 'comp.lang.fortran' 
=(don't ask why) and I came across the following article:
=
=< Article 1784 of comp.lang.fortran
=
=< From: bobal at microsoft.UUCP (Bob Allison)
=< Reply-To: bobal at microsoft.UUCP (Bob Allison (uunet!microsoft!bobal))
=< Distribution: usa
=< Organization: Microsoft Corp., Redmond WA
=< Lines: 39
=< 
=< Not that this has anything to do with FORTRAN, but for those of us
=< who love autoindent, but don't like tabs, the appropriate vi setting is:
=< 
=< :set ai ts=90
=< 
=< This is great since it will autoindent, but it won't use a tab unless you're
=< beyond the 90th column (I rarely write a line longer than 80 characters), so
=< it just blank-fills.
=< 
=
=[stuff about Fortran 88 deleted ]
=

Although ":set ai ts=90" does what Bob said in the article, it has its
problem when you put it into .exrc file. If this line exists in .exrc file, 
it will simply expand every tab to 90 spaces. It is really painful when you
are editting a old file with tabs in it. Does any one have a better way to 
solve the tab problem ???

-----------------------------------------------------------------------
                                   |
USMAIL:   Guangliang He            |  INTERNET: ghe at PHYSICS.ORST.EDU
          Department of Physics    |            ghe at jacobs.CS.ORST.EDU
          Oregon State University  |  BITNET:   hegl at orstvm.bitnet
          Corvallis, OR 97331      |  PHONE:    (503) 737-4631
                                   |
-----------------------------------------------------------------------



More information about the Comp.unix.questions mailing list