Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!usc!ucsd!sdcsvax!ucsdhub!hp-sdd!ncr-sd!ncrlnk!ncrcce!mercer From: mercer@ncrcce.StPaul.NCR.COM (Dan Mercer) Newsgroups: comp.editors Subject: Re: mapping TAB to spaces in Vi Keywords: Vi, mapping TAB character Message-ID: <1367@ncrcce.StPaul.NCR.COM> Date: 28 Jun 89 21:54:40 GMT References: <363@ai.cs.utexas.edu> Reply-To: mercer@ncrcce.StPaul.NCR.COM (Dan Mercer) Organization: NCR Comten, Inc. Lines: 28 In article <363@ai.cs.utexas.edu> meyering@cs.utexas.edu (Jim Meyering) writes: : :In Vi's input mode, is it possible to map the TAB :character to a string of space characters? : :Jim Meyering meyering@cs.utexas.edu :-- :Jim Meyering meyering@cs.utexas.edu All depends on what system you're running vi. Under UNIX SYSV, use newform command by piping data (using ! operator or :a,b ! ex command line command) to newform with -i tabspec option. For instance, if you have a file with tabs set at every 4 spaces, the following character sequence will retab the whole file: 1G!Gnewform -i-4 Note that the tabspec sepcifies -4 (minus 4). If the tabspec said 4, then only the first tab on the line would be changed, and then to move the data to column 5. Irregular tabs are supported as well. For example, to set tabs for an IBM assembler listing<; 1G!Gnewform -i 1,10,16,36,72 -- Dan Mercer Reply-To: mercer@ncrcce.StPaul.NCR.COM (Dan Mercer)