> Okay, now that I'm playing with my settings im getting really
> inconsistent results that I cant really explain.
> 
> If I open up a new buffer, with the following two lines in it
> 
> <tab>good tabs
> #<tab>bad tabs
> 
> the command seems to work exactly correctly, whether my ":set et", or
> my ":set noet" is active

As an aside from ":help retab", make sure to note that "this 
command sets 'tabstop' to the new value given".  I'm not sure if 
that's within the context of the previous line's "if 'et' is set" 
or not.  By calling :retab multiple times, it may be confused.

You might try

   :set et
   :g/^#/set ts=100 | .retab! | set ts=4

which seemed to do what I think you want.  Alternatively, you 
could do something like

   :g/^#/s/\t/\=repeat(' ', 100)/g

I use a variant of this to prevent tab-expansion if it's not part 
of the leading whitespace:

   :%s/^\t\+/\=substitute(submatch(0), '\t', '    ', 'g')

Hope this helps.

-tim




--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply via email to