>> If a line contains a , this , should have only one space character and
>> also only one space character
>> after it. How do you do that?
>>
>> So the following:
>>   sX,sY
>>   sX ,sY
>>   sX, sY
>>   sX    ,      sY
>>
>> Must all be come  (the last one should be trimmed to one space before
>> and after the ,)
>>   sX , sY
> 
> Imho with a simple :1,$ s@ *, *@, @g'

Based on the OP's example, that's missing a space before the 
replacement comma:

   :%s/ *, */ , /g

should do the trick.  If tabs are to be considered spaces too, 
you can use

   :%s/\s*,\s*/ , /g

instead.

-tim



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

Reply via email to