Say I have the following line:

foo = getFoo()

It would be convenient to be able to do a single :s/foo/bar/g that respects 
the case of the original input. It would transform the input line into the 
following:

bar = getBar()

Would it be possible to add this as an option to :substitute somehow? I toyed 
with writing a script to do it, but wasn't able to get very far (obviously, I 
could do this by setting noignorecase and doing :s/foo/bar/g 
and :s/Foo/Bar/g, but it would be more convenient to just use a single 
command).

JKB

Reply via email to