Re: infercase for :substitute?

2007-03-30 Thread Ingo Karkat

Martin Stubenschrott wrote:

On Thu, Mar 29, 2007 at 04:29:38PM -0700, Joseph Barker wrote:

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


Have you tried: http://www.vim.org/scripts/script.php?script_id=6

I think it does exactly what you want.

--
Martin


There's another script, SmartCase, which only slightly differs from keepcase.vim 
in the semantics of its invocation: 
http://www.vim.org/scripts/script.php?script_id=1359


-- regards, ingo


Re: infercase for :substitute?

2007-03-30 Thread Martin Stubenschrott
On Fri, Mar 30, 2007 at 09:00:44AM +0200, Ingo Karkat wrote:

 There's another script, SmartCase, which only slightly differs from 
 keepcase.vim in the semantics of its invocation: 
 http://www.vim.org/scripts/script.php?script_id=1359

I have used that for some time, but was wondering why it has this bad
votings, maybe it doesn't work well in last versions? Or only some
stupid bot?