tabs in vi

George Kyriazis kyriazis at plato.rdrc.rpi.edu
Thu Aug 24 07:33:06 AEST 1989


In article <12187 at orstcs.CS.ORST.EDU> ghe at nucthy.PHYSICS.ORST.EDU (Guangliang He) writes:
>In article <36790001 at hpindwa.HP.COM> sgordon at 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.
>=


Well, while in vi you can do

	:g/./s/	/    /g

	       ^  ^
	       |  4 spaces
	       a TAB character

That will replace every TAB with 4 spaces in your whole file.



  George Kyriazis
  kyriazis at turing.cs.rpi.edu
  kyriazis at rdrc.rpi.edu
------------------------------



More information about the Comp.unix.questions mailing list