On 3 Feb, 11:16, "A. S. Budden" <[email protected]> wrote:
> On 3 February 2010 10:12, James Kanze <[email protected]> wrote:

> > I was wondering if there was a simple way to define a recorded
> > sequence in vim which doesn't terminate if a :s command doesn't
> > find any matches.  Basically, I'm converting blocks of C++ code
> > to C++ strings, with things like
> >        :'a,'bs/"/\\:/g
> > .  Except that not all of the blocks contain strings, so
> > sometimes, this search and replace will fail.  I'd like the
> > recorded sequence to continue in such cases.

> Have you tried the 'e' flag to substitute?

>     :'a,'bs/"/\\:/ge

>     :help :s_flags

That works like a charm.  Thanks.

> For information, also see

>     :help :silent

> In particular :silent!

That would have possibly allowed me to use the original saved
sequence, but in theory at least, there are one or two sequences
that I look for that should be there; if they aren't, then an
error would be nice.  (In practice, I don't think that the case
where they aren't actually occurs, so it shouldn't be an issue.)

--
James Kanze

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

Reply via email to