Loading ...
Sorry, an error occurred while loading the content.

Re: Motion for Cammel Notation

Expand Messages
  • Yakov Lerner
    ... Another working solution to using search(): function! CamelCase() call search( u | W ) endfunction ... Yakov
    Message 1 of 9 , Jul 4, 2006
    • 0 Attachment
      On 7/5/06, Michael Naumann <michael@...> 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
    Your message has been successfully submitted and would be delivered to recipients shortly.