X-Recipient: archive-cygwin AT delorie DOT com DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:content-type:mime-version:subject:from :in-reply-to:date:content-transfer-encoding:message-id :references:to; q=dns; s=default; b=QXSwSCSfMWwdm1rR7vDbYMpkS88l 5rv0zLAw6JSXaZjFCqUOuNBbnk8RNjoJmfFuK20WQ7EDbKwPf7PLwXHWU94FU0f3 vmnrfRX3xxUIHKavKYYZ5oN0QrTtdLe8Dn7M+oKwwszylxdyWZGZkC7WIZoS6P2E Zpowrlvts19WHPk= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:content-type:mime-version:subject:from :in-reply-to:date:content-transfer-encoding:message-id :references:to; s=default; bh=whhZWZ+KWeHHlW9obDs2dz92DLo=; b=Wn EHCFIiKi7WT+m9a5pTwbHj5p4qhhpTVPwz/dgUU4HHaFNgRO+UR8ouMl6tOXsu2H gNt69JiyYU5TbCcDB7cD+3Pz6CstOrp5Hesx+Eilrm4PzDOM6EsuwatMb5KBbRML dq9b9AF4fDY58UEUeZMkGw3LhQaml4fC82/sAkNmY= Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=0.5 required=5.0 tests=AWL,BAYES_50,KAM_LAZY_DOMAIN_SECURITY,RP_MATCHES_RCVD autolearn=no version=3.3.2 X-HELO: etr-usa.com Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2102\)) Subject: Re: How to expand tabs? Where is expand program. From: Warren Young In-Reply-To: Date: Thu, 2 Jul 2015 18:55:54 -0600 Message-Id: <5846E9A5-C9D0-4DE9-9681-FF66488E56CE@etr-usa.com> References: <701185250 DOT 1353195 DOT 1435878843444 DOT JavaMail DOT yahoo AT mail DOT yahoo DOT com> To: The Cygwin Mailing List X-IsSubscribed: yes Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id t630u858001963 On Jul 2, 2015, at 6:46 PM, Warren Young wrote: > > Say :set expandtab. Now you don’t need expand(1) at all. :) Ooops, Ernie’s answer made me look deeper, and it’s a bit more complicated. I forget because I’ve wrapped it up into a couple of macros which I keep in my ~/.vimrc file: function SpaceTabs(spaces) exe "set sw=" . a:spaces exe "set ts=" . a:spaces exe "set expandtab" exe "set smarttab" exe "retab" endfunction function TabTabs(stops) exe "set ts=" . a:stops exe "set sw=" . a:stops exe "set noexpandtab" exe "set nosmarttab” endfunction So, “:call SpaceTabs(4)” is roughly equivalent to “expand -t4 < old > new”, except it works in-place. -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple