You can also    :set expandtab
or              :set et

Which replaces tabs with spaces at whatever ts (tabstop) distance you
prefer.  Note that whenever you set ts you also want to set sw.
(shiftwidth).

If you use et, you never have to worry about what someone else has his
ts set to, the file will ALWAYS read with the original indentation. (at
the expense of making the file just a little bigger).  

I use the following in my .vimrc file:

set ts=3 sw=3
set et

and at the bottom I add (for ebuild files) because that is what the
gentoo folks want: 

if (getcwd() =~ 'gentoo-x86\|gentoo-src\|portage')
        set tabstop=4 shiftwidth=4 noexpandtab
endif

This requires that I be IN or below one of the named directories when I
edit the ebuild, for it to work. And I usually am, if I am not just
inspecting things.

Lincoln

On Tue, 2003-06-24 at 21:18, [EMAIL PROTECTED] wrote:
> On Tue, Jun 24, 2003 at 09:07:32PM -0400, Mike Principito wrote:
> 
> > This is a bit off topic, but I'm curious if anyone knows how to set up a
> > tab to be 3 spaces instead of a tab character in vim. I'm assuming I'd
> > have to add something to my .vimrc, but I don't know what. Any help would
> > be appreciated.
> 
> Well, the answer is ":set tabstop=8", but I'd recommend ":set
> shiftwidth=3" and leaving tabs hard set to 8 (then anyone viewing your
> file will still see your desired indentation).  Just use ^T and ^D in
> insert mode to tab/backtab, >> and << to indent/un-indent in command
> mode.
> 
> Regards,
-- 
Lincoln A. Baxter <[EMAIL PROTECTED]>


--
[EMAIL PROTECTED] mailing list

Reply via email to