On 7/5/06, Michael Naumann <[EMAIL PROTECTED]> wrote:
On Tuesday 04 July 2006 08:58, Jürgen Krämer wrote:
> a function already takes care of not changing the last used search
> pattern and the redo command, so
>
>   function! U()
>       /\u\|\W
>   endfunction
>
>   :onoremap u :call U()<cr>
>
> should be enough.

In fact it will only work correctly with normal, as in>

Another working solution to using search():

function! CamelCase()
   call search('\u\|\W')
endfunction
:onoremap u :call CamelCase()<cr>


function! UpperOrWord()
    normal /\u\|\W^M
endfunction

:onoremap u :call UpperOrWord()<cr>

Note: the ^M is entered by ctrl-v ctrl-m

Yakov

Reply via email to