Bob Miller wrote,
>If you set the terminal emulator's tab stops, it will affect cat,
>more, gzcat, and other programs that know nothing about the output
>device, but it won't help emacs, vi, or less.

And usually you don't need to set your emulator's tab stops...most
emulators automatically start up with tabs in columns 1, 9, 17, 25, etc.,
which is what most software expects.

>I don't know about vi, and Randolph already told you how to do it
>for less.

Vi will display files with tabs in them using the current tab stop
settings.  If these aren't in the standard 8-column positions, you need to
tell vi where they are--I think this is done with the ":set tabstop="
command (though I've never gotten that to work very well).  For example, if
you have your tabs set ten columns apart, I think you would tell vi ":set
tabstop=10".  (The word "tabstop" can be abbreviated "ts".)

For programming work, I find the ":set shiftwidth=" (or ":set sw=") command
to be much more useful than ":set tabstop=".  It sets the number of columns
that control-T indents, and also the number of columns of indentation added
by ">>" and taken away by "<<".  I like to indent four columns at a time
instead of the default eight, so I usually say ":set sw=4" when I start up vi.

(Actually, I say ":set ai sm sw=4 wm=0", which expands to ":set autoindent
showmatch shiftwidth=4 wrapmargin=0", but that's another story...)

              - Neil Parker

Reply via email to