un-indenting doesn't work with vim

Sam Hanes elemecca@gmail.com
Wed Jul 16 17:50:00 GMT 2008


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:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/



More information about the Cygwin mailing list