On Mon, May 16, 2011 at 11:36 PM, Ingo Karkat <[email protected]> wrote:

> On 17-May-2011 03:42, [email protected] wrote:
> > For the record, I have gone through the solutions at this wiki:
> > http://vim.wikia.com/wiki/Moving_through_camel_case_words; however, I
> > was still left wondering if there has been an attempt to solve the
> > camel case word movement natively in Vim, as a lot of code does use
> > this convention.
> >
> > I was thinking of a simple extension: key off the 'iskeyword' option
> > in-addition with a 'camelcase_keyword_movement' boolean option which
> > would treat the 'iskeyword' as separate character sets.
>
> I am the author of camelcasemotion
> (http://www.vim.org/scripts/script.php?script_id=1905), which is a
> vimscript
> implementation based off the mentioned Vim tip. The plugin supports both
> CamelCaseWords and underscore_notation, which I think is a crucial
> requirement,
> also for any native solution, because:
> 1. both notations complement each other, sometimes are even used together
> (e.g.
> CamelCase_MixedNotation)
> 2. both overloading the default w/e/b mappings or providing additional ones
> (the
> plugin defaults to ,w/,e/,b) covers / consumes a lot of mappings, and
> therefore
> should be as general and applicable as possible.
>
> The many users who have downloaded the plugin seem to be quite happy with
> it,
> even though there are some rare corner cases where it won't work right. I
> agree
> with you that for something so common as CamelCaseWords and
> underscore_notation,
> a native implementation built into Vim would be beneficial. However, I
> would
> argue that such an implementation would have to be general (i.e. covering
> at
> least CamelCaseWords and underscore_notation), configurable (e.g. override
> /
> additional mappings, select underscore separators [_-], stuff like
> 'iskeyword'),
> and complete (covering motions as well as new text objects).
> If someone is motivated to invest the huge effort that such a full
> implementation would comprise (and Bram signals that he'd consider
> including
> such an enhancement), I'd be happy to provide feedback and reviews.
>
> -- regards, ingo
>

Ingo -- I did check out your plugin, and I might actually end up using it
regularly :). There were a basic things
which caught my eye as incomplete: Is there a reason you didn't choose to
implement the 'ge' operator?

o  <Plug>CamelCaseMotion_ie * :<C-U>call
camelcasemotion#InnerMotion('e',v:count1)<CR>
o  <Plug>CamelCaseMotion_ib * :<C-U>call
camelcasemotion#InnerMotion('b',v:count1)<CR>
o  <Plug>CamelCaseMotion_iw * :<C-U>call
camelcasemotion#InnerMotion('w',v:count1)<CR>
o  <Plug>CamelCaseMotion_e * :<C-U>call
camelcasemotion#Motion('e',v:count1,'o')<CR>
o  <Plug>CamelCaseMotion_b * :<C-U>call
camelcasemotion#Motion('b',v:count1,'o')<CR>
o  <Plug>CamelCaseMotion_w * :<C-U>call
camelcasemotion#Motion('w',v:count1,'o')<CR>

-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Raspunde prin e-mail lui