Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!csd4.csd.uwm.edu!uakari.primate.wisc.edu!indri!pikes!boulder!stan!dce From: dce@Solbourne.COM (David Elliott) Newsgroups: comp.unix.questions Subject: Re: tabs in vi Message-ID: <2068@marvin.Solbourne.COM> Date: 23 Aug 89 16:55:37 GMT References: <7901@ardent.UUCP> <36790001@hpindwa.HP.COM> Reply-To: dce@Solbourne.com (David Elliott) Organization: Solbourne Computer Inc., Longmont, Colorado Lines: 23 In article <36790001@hpindwa.HP.COM> sgordon@hpindwa.HP.COM (Shaun Gordon) 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. I think all solutions to this assume that "I get 4 spaces" really means "I get to the next column for which column%4 == 0". To get exactly 4 spaces for a tab is pretty hard in the general case, since it's hard to map tab and hard to get spaces in the mapping. What you really need, as Shaun points out, is >set tabstop=4 In addition, you should set shiftwidth=4 so that > and < will use the expected units. -- David Elliott dce@Solbourne.COM ...!{uunet,boulder,nbires,sun}!stan!dce "I had a dream that my kids had been reparented." - Tom LaStrange