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: How to expand tabs? Where is expand program.


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


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