On 02/11/08 08:04, bill lam wrote:
> On Sun, 02 Nov 2008, Tony Mechelynck wrote:
>
>> On 02/11/08 04:37, bill lam wrote:
>>> On Sat, 01 Nov 2008, Tony Mechelynck wrote:
>>>> :%s/\[\(\x\x\x\x\)?]/\=eval('"\u' . submatch(1) . '"')/g
>>> Thanks. This works. Those files were edited using m$ ime that did not
>>> support codepoint above U+10000.
>>>
>>> A related question. I have a number of such files that need fixes.
>>> How do I grep and replace them all under linux.
>>>
>> :args file1 file2 *.tex foo???bar.baz
>> :argdo %s/...from.../...to.../ge
>>
>> "from" pattern and "to" expression same as above
>> any number of files (with wildcards if desired) in the :args command
>>
>
> Thanks! I found that it also needs autowrite and argdo!.
>
ah, yes, you may add |update at the end of the argdo line to write the
file (if changed) after the substitute, and :new before :argdo to avoid
problems if the current file is 'modified' (with :argdo! if the current
file is 'modified' the changes will be lost), or, like me (and this is
why I forgot) you may set 'autowriteall' in your vimrc.
Best regards,
Tony.
--
hundred-and-one symptoms of being an internet addict:
243. You unsuccessfully try to download a pizza from www.dominos.com.
--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---