2009/3/16 Tim Chase <[email protected]>:
>
> A. S. Budden wrote:
>> 2009/3/16 Horvath Adam <[email protected]>:
>>> Dear List Members!
>>>
>>> I need to correct sql dump files:
>>>
>>> Question 1:
>>>
>>> I like to this with vimscript:
>>> :%s/xxx/yyy/g
>>> For all line in buffer and all occurencies in line
>>>
>>> How can it be done wiht script?
>>
>> There may be better ways, but here's one possibility:
>>
>> for l in range(line('$'))
>>   call setline(l, substitute(getline('l', 'xxx', 'yyy', '')
>> endfor
>
> Ex commands are usable as-is in scripts.  Just remove the leading
> colon:
>
>   %s/xxx/yyy/g
>
> it doesn't get much easier to translate ;-)

I knew there would be a better way!

Al

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

Reply via email to