* 'c.willis111' via vim_use <
vim...@googlegroups.com> wrote:
> as you say, the task is not terribly clear.
> Once you've done a
> /^keyword
> you can find further instances with
> n
That's what I said.
> > Is there anyway to search and replace in a single colon command? Like ...
> >
> > :%s/^keyword/do_keystrokes/g
> > or
> > :%s/^keyword/do_a_macro/g
> It is not clear if you have some rule for the case required for various
> words. I notice that case occurs with different capitalisation where it
> hasn't obviously been mangled. If there's no rule, you're stuck with
> going through them all. The usual swap case is just
> ~
I know ~ and I have said that. Practically, there are many more keystrokes in different situations other than those of the letter case. Probably, my example is not good enough. My real question is that how to apply keystrokes in a single colon (:) command.
> So you can go through finding the next keyword with n and then right
> arrowing or tilding to get that line right.
> If on the other hand you can devise a rule for the capitalization, you
> can devise a set of commands such as
> :g/^keyword/s/toggle\c/TOGGLE/
> :g/^keyword/s/CASE\c/CASE/g
> :g/^keyword/s/CASE$/Case/
Probably, :g is what I am looking for. I previously thought of :%s. Thanks,
I shall try that.
Thank you very much.
--
Gua Chung Lim