SUMMARY: vi and tabs.

From: Simon-Bernard Drolet (
Date: Tue Jan 19 1999 - 08:47:46 CST

Hi Sunners,

My original questions was:

> Hi Sunners,
> In vi, is there a way to replace a <tab> char by 8 spaces everytime I
> type in <tab> ?
> I'm using Solaris 2.6...
> Thank's.

Thank's to:
"Eric D. Pancer" <>
"Michael Little" <>
Jon LaBadie <>
"David Evans" <>
Bevan Broun <>
Grant Beattie <> (Sanjiv K. Bhatia)
Stefan Voss <> (Umesh C Singhal)
Warren Jones <>

And the answer we wanted was to use the map command in vi.

So in command mode in vi, entering ':map!' then a <space>, a <ctrl-v>,
<ctrl-v>, <tab>, <space> and
then a <ctrl-v>, <ctrl-v> and then 8 <space> will do it.

This will map any <tab> and replace it by 8 <space> when typed in. You
can type all of this in a .exrc file and make sure your EXINIT file
doesn't override it. If you try it and it doesn't work, make sure the
option 'exrc' is set. So in command mode, if you do a ':set all", you
should have somewhere a "exrc", not a "noexrc" !

PS: Some of those guys recommanded 'vim' !


Simon-Bernard Drolet      mailto:Simon-Bernard.Drolet@M3iSystems.QC.CA
Unix System Administrator Tel: (450) 928-3386 ext. 2330
M3i Systems Inc.          Fax: (450) 442-5076
Longueuil, Quebec, Canada http://www.M3iSystems.QC.CA

This archive was generated by hypermail 2.1.2 : Fri Sep 28 2001 - 23:13:14 CDT