[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: vim & tab & space



Chanop Silpa-Anan wrote:
> 
> Once upon a time, I heard Eric G. Miller say
> 
> > On Thu, Apr 05, 2001 at 09:37:58PM +1000, Chanop Silpa-Anan wrote:
> > >
> > > Hi,
> > >
> > > This is not really debian topic, but since I got the idea from dpkg-scanlibs
> > > thread from debian-devel two months ago.
> > >
> > > In vim, what is the setting to use tab for indent and space for alignment? I
> > > couldn't figure it out since vim always try to use tab instead of space.
> > >
> > > e.g. when I use ts=4, sw=4 and has a line like this
> > >
> > > [tab][tab]printf ("Hello World \
> > >
> > > when I press enter vim will try to insert [tab] like
> > >
> > > [tab][tab][tab][tab]here I can start typing again\n");
> > >
> > >
> > > What is the setting to get rid of the third (and forth and ..) tab that is
> > > not for indenting but for aligning?
> >
> > I believe you're referring to "cindent", when syntax=c is on...
> >
> > :set cindent=off ???
> 
> I want automatic indenting feature. No matter mode tried to set,
> autouindent, smartindent, and cindent, vim always try to minimize usage of
> space by filling in tabs according to ts.
> 
> I just wonder whether there is a way to fine tune this or not?

  I don't think there is a difference (in vim's point of view) between
what you describe as indent and align.

  you can make vim use tab characters or replace them by space (I guess
you knew that already), but that's for everything...

  from what you describe I am not sure whether you want to replace the
second pair of tabs by spaces or whether you simply want them not to be
there. the latter can be probably configured via setting properties of
cindent (or smartindent or something).

	erik



Reply to: