Path: utzoo!utgpu!water!watmath!clyde!rutgers!mit-eddie!husc6!cmcl2!nrl-cmf!ames!pasteur!ucbvax!sdcsvax!ucsdhub!esosun!seismo!uunet!mcvax!botter!ark!maart From: maart@cs.vu.nl (Maarten Litmaath) Newsgroups: comp.unix.questions Subject: Re: to space under vi, VI SUMMARY COMING SOON... Keywords: vi, tab, vi summary Message-ID: <1180@ark.cs.vu.nl> Date: 22 Jan 88 19:16:54 GMT References: <462@gordon.UUCP> <239@unicom.UUCP> Reply-To: maart@cs.vu.nl (Maarten Litmaath) Organization: VU Informatica, Amsterdam Lines: 28 In article <239@unicom.UUCP> daniel@unicom.UUCP (Dan "I want to Ski Tam!" Smith) writes: \In article <462@gordon.UUCP> kelvin@gordon.UUCP (Kelvin Lam) writes: \>To all the 'vi' expert out there(I hope this is the right group!) \> \>Is there a way to force 'vi' editor to insert appropreiate number of spaces \>when key is hit? That is, instead of inserting the actual , \>n number of spaces are inserted. \ \ :g/ /s// /g # this is NOT what Kelvin wants: the number of spaces isn't always eight ! \Vi won't let you map the tab key, or I would suggest making a map! (input \mode macro) for it. # this is not true; it's a bit difficult, but it can be done: # use ":map ^V^V^I ^T" e.g. to map tab to "move one shiftwidth to the right" # Remarks: # 1) ^V = control-v (within vi you have to escape the tab, because # it's a separator), ^I = tab, ^T = control-t # 2) you can set the shiftwidth with e.g. ":set sw=4" (default 8) # 3) I can't find a proper solution to the problem myself # 4) I've got an extended vi manual on line (I think it's GOOD); # anybody interested ? Regards. -- Time flies like an arrow, fruit flies |Maarten Litmaath @ Free U Amsterdam: like an orange. (seen elsewhere) |maart@cs.vu.nl, mcvax!botter!ark!maart