On 7/3/06, Giorgos Gaganis <[EMAIL PROTECTED]> wrote:
Tim Chase wrote:
>>> I would particularly want to use it with the 'c' command.
> [cut]
>> I'm using c quite often. I wouldn't remap it ;)
>
> I think the OP wants an (in vim nomenclature) "operator pending mode
> mapping", so that it can be used *with* the "c" command, rather than
> *instead* of the "c" command.
>
> :onoremap > /\u<cr>
> :onoremap <lt> ?\u<cr>
>
> This pair of mappings will allow one to do
>
> c>
>
> or
>
> c<
Thank you very much for your answers.
What Tim suggested is doing the job with the following modification
:onoremap u /\u\\|\W<cr>
the above works like 'cw' but also stops on uppercase letters.
Although it does the job there is a really annoying side-effect. Because
it uses a search all uppercase and nonword chars are highlighted which
makes the screen practically unreadable.
Preserving search pattern will resolve the
side-effect you mention. The following works for me:
function! U()
let x=@/
/\u\|\W
let @/=x
endfun
:onoremap u :call U()<cr>
I tried to make this into one-liner but failed. Multiple
commands on the rhs of omap didn't work for me, so I
packaged rhs as a function.
Yakov