This is the mail archive of the
cygwin
mailing list for the Cygwin project.
Re: How to expand tabs? Where is expand program.
- From: Warren Young <wyml at etr-usa dot com>
- To: The Cygwin Mailing List <cygwin at cygwin dot com>
- Date: Thu, 2 Jul 2015 18:55:54 -0600
- Subject: Re: How to expand tabs? Where is expand program.
- Authentication-results: sourceware.org; auth=none
- References: <701185250 dot 1353195 dot 1435878843444 dot JavaMail dot yahoo at mail dot yahoo dot com> <DC315DD3-D309-4473-BF93-743721D42082 at etr-usa dot com>
On Jul 2, 2015, at 6:46 PM, Warren Young <wyml@etr-usa.com> 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