Monday, November 14, 2011

Re: autocommand to replace special characters into a file.

yes I know s/string1/string2 will not replace ^M or ^A ;
I just want to make a first try to replace string1 to string2 first
before replacing "string1" by "^M"

2011/11/14 Tony Mechelynck <antoine.mechelynck@gmail.com>
On 14/11/11 11:37, Eddine wrote:
Hello
At work I have to edit regurlarly files containing special characters
like*^M or ^A*

for the moment Im' at the first stage where I just try to make replace a
string by another one in my autocommand:

   *au VimEnter,BufNewFile,BufRead,BufEnter  *.log  s/string1/string2/*


But this doesn't give me good results:
Wehn opeining a .log file, Vim prompts me to know if I want to replace
the first occurence ;
hitting "y" (yes key) change the first matching one then brings me error
messages :

   E488: trailing characters
   E486: pattern not found string1

Any mean to make it replace all matching strings whitout prompting and
without error ?
Thanks in adavance for your help.
Eddine.


_Exactly_ what command did you use? s/string1/string2 (where string1 is six letters, Sierra Tango Romeo India November Golf, and the digit one) will never replace a ^M or a ^A

Best regards,
Tony.
--
There was a gay countess of Bray,
And you may think it odd when I say,
       That in spite of high station,
       Rank and education,
She always spelled cunt with a "k".

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

No comments: