Path: utzoo!mnetor!uunet!mcvax!hansm From: hansm@cwi.nl (Hans Mulder) Newsgroups: comp.editors Subject: Re: Tabs and vi Message-ID: <197@piring.cwi.nl> Date: 10 Feb 88 18:14:09 GMT References: <20655@bbn.COM> Organization: CWI, Amsterdam Lines: 41 In article <20655@bbn.COM> cosell@bbn.com (Bernie Cosell) writes: > >Two questions about tabs from within vi: > a) for a variety of reasons, I _despise_ true TAB chars. Is there a > way to have vi _never_ use them (and just always use the right number > of spaces). I'm not exactly sure what you want. If you want to replace all TABs in your file by the correct number of spaces, type 1G!Gexpand. This runs your entire buffer through expand(1). If you don't want to see TABs displayed as whitespace, you might want to :set list. This displays (among other things) tabs as ^I. If you don't want vi to use TABs to position your cursor, remove the pt capability from your TERMCAP entry. > b) If I can't have (a), can I at least prevent vi from autoindenting > by using tabs? () That happens to be easy, just :set tabstops=1024. As you can't have lines that long this effectively stops vi from ever producing tabs. Of course, your file should not contain any TABs when you do this. (And the output of the :map command is messed up.) > I generally run along with :set ai, and the > shiftwidth=4, and what it seems happens is that vi uses > a TAB character for every of indenting (which of course > looks _great_ once I go back to UNIX where the tab chars become 8 > positions again. :- You can correct this by running your file through expand -4. I am currently running vi version 3.7, 6/7/85 under BSD 4.3, with :set ai sw=2 and it works correctly, i.e. it generates a TAB for every of indenting. Hope this helps, > Bernie Cosell Hans Mulder