Path: utzoo!attcan!uunet!cs.utexas.edu!rutgers!orstcs!nucthy!ghe From: ghe@nucthy.physics.orst.edu (Guangliang He) Newsgroups: comp.unix.questions Subject: Re: Vi and tabs (RTFM?) Keywords: vi tabs rtfm Message-ID: <11316@orstcs.CS.ORST.EDU> Date: 21 Jun 89 07:14:09 GMT References: <4732@alvin.mcnc.org> <2852@helios.ee.lbl.gov> Sender: usenet@orstcs.CS.ORST.EDU Reply-To: ghe@nucthy.PHYSICS.ORST.EDU (Guangliang He) Organization: Dept. of Physics, Oregon State University Lines: 55 In article <2852@helios.ee.lbl.gov> envbvs@epb2.lbl.gov (Brian V. Smith) writes: =In article <4732@alvin.mcnc.org>, spl@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@microsoft.UUCP (Bob Allison) =< Reply-To: bobal@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@PHYSICS.ORST.EDU Department of Physics | ghe@jacobs.CS.ORST.EDU Oregon State University | BITNET: hegl@orstvm.bitnet Corvallis, OR 97331 | PHONE: (503) 737-4631 | -----------------------------------------------------------------------