Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!iuvax!rutgers!apple!sun-barr!newstop!texsun!texbell!nuchat!steve From: steve@nuchat.UUCP (Steve Nuchia) Newsgroups: comp.unix.questions Subject: Re: tabs in vi Message-ID: <13800@nuchat.UUCP> Date: 23 Aug 89 19:33:36 GMT References: <7901@ardent.UUCP> <36790001@hpindwa.HP.COM> Reply-To: steve@nuchat.UUCP (Steve Nuchia) Organization: Houston Public Access Lines: 24 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 >While inside vi you can type a colon to get to the command line and then enter: >set tabstop=4 I don't recommend that, since everything else in the world -- print formatters and other people's screens to name two -- will continue to assume tabstops at 8 columns. In fact there is no way to make vi insert anything other than a tab when you hit the tab key. What I do recomend is leaving tabstop alone and setting shiftwidth=4. This allows you to use ^T as a soft tab and << and >> will shift lines in four column increments -- just right for programming. Most people will find it handy to also set autoindent. ^D in insert mode will delete one shiftwidth of leading indentation. Another handy vi idiom for programmers -- you can shift a whole block of C by combining the < or > shift operators with the % (bracket match) command as a target specifier. -- Steve Nuchia South Coast Computing Services uunet!nuchat!steve POB 890952 Houston, Texas 77289 (713) 964 2462 Consultation & Systems, Support for PD Software.