delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2008/07/16/13:50:46

X-Recipient: archive-cygwin AT delorie DOT com
X-Spam-Check-By: sourceware.org
Message-ID: <4cee11bc0807161050l3c289515sdd99ec37f9f380f1@mail.gmail.com>
Date: Wed, 16 Jul 2008 10:50:14 -0700
From: "Sam Hanes" <elemecca AT gmail DOT com>
To: cygwin AT cygwin DOT com
Subject: Re: un-indenting doesn't work with vim
In-Reply-To: <f68d89470807160249t7ccd06e5o90e0ff5a606819df@mail.gmail.com>
MIME-Version: 1.0
References: <f68d89470807110553k2bc71311p799af2cc02e99af8 AT mail DOT gmail DOT com> <20080711130135 DOT GO24644 AT calimero DOT vinschen DOT de> <f68d89470807160249t7ccd06e5o90e0ff5a606819df AT mail DOT gmail DOT com>
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

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/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019