How to expand tabs? Where is expand program.
Warren Young
wyml@etr-usa.com
Fri Jul 3 00:55:00 GMT 2015
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
More information about the Cygwin
mailing list