This is the mail archive of the cygwin mailing list for the Cygwin project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: un-indenting doesn't work with vim

Robert Latest wrote:
> Thanks folks, I didn't know about Ctrl-D. Of course that's all I'm
> gonna use now, because it is so Vim. One thing that I don't understand
> is that <Tab> indents eight spaces whereas Ctrl-D un-indents only
> four. I'll check on that. Actually I've got ":set sw=4" in my vimrc,
> maybe that has  to do with it.

That's because tab indents `tabstop` spaces, and ^D un-indents
`shiftwidth` spaces.

`tabstop` sets what a literal HT (ASCII 0x09 - Horizontal Tab) means
in terms of spaces. This affects what happens what happens when you
press the TAB key and how groups of spaces in files are interpreted if
you have that feature turned on.

`shiftwidth` controls how many spaces VIM considers to be one level of
indentation. This affects the auto-indentation system, ^T and ^D, etc.

If `tabstop` and `shiftwidth` are set to different values, strange
things happen if you use tab to indent.

-- Sam Hanes
elemecca AT gmail DOT com

Freedom is a heavy load, a great and strange burden for the spirit to
undertake. It is not easy. It is not a gift given, but a choice made,
and the choice may be a hard one. The road goes upward towards the
light; but the laden traveler may never reach the end of it.
- Ursula K. Le Guin; The Tombs of Atuan

Unsubscribe info:
Problem reports:

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]