vi tabs

rad at mitre-bedford.ARPA rad at mitre-bedford.ARPA
Fri Jan 4 09:25:10 AEST 1985


>A vi question (they don't give out complete manuals here, it seems):

  Give me a break.  We hand out everything that comes from Bezerkley.
Did you know enough to ask the librarian for the ex documentation too?

>How can one get vi to cease putting actual tab chars into files?

  If you type tab characters into a file, vi will put them there.  If
you want auto-indenting without using the physical tab key, check out
the autoindent feature (which uses control-t and control-d for tabbing
and detabbing at specifiable sizes).  Use another Unix utility, called
"expand", to change tabs to spaces.  You can even bind a macro to a
vt100 function key to "expand" the entire file.  Put this in a .exrc
file in your home directory:

map #4 1!Gexpand^M

where the ^M is a carriage return inserted into the .exrc file by
preceding it with a control-V.  Hitting PF4 (at the upper right hand
corner of the keyboard) will then kill all of the tabs in your file,
with the minor side affect that the cursor will be placed at the
beginning of your file.

Dick Dramstad
rad at mitre-bedford.arpa



More information about the Comp.unix mailing list