Gary,

let me explain what I'm trying to do in as simple of terms as
possible. Consider the following file

<tab>good tab
<tab>good tab
#<tab>bad tab
#<tab>bad tab
<tab>good tab
<tab>good tab
#<tab>bad tab
#<tab>bad tab

I want to run a command which will retab only those lines where it
says "bad tab". I match those lines with the regexp /^#/

I exactly reproduced your testcase, with precisely the same results.
Your explanation makes complete sense and I believe the entire
situation is clear to me now. The key is that the entire retab
operation is occuring N times (once per matching line) which includes
resetting the tabstop value.

Using Tim's suggestion, and going back to my original post, I am now
using the command

:g/^#/.ret! 100 | set ts=2

which resets the tabstop after each line. With this modification, it
works perfectly.

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

Reply via email to