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

69175Re: Variable for "motion type" in Operator-pending mode

Expand Messages
  • glts
    Apr 19, 2013
    • 0 Attachment

      On Fri, Apr 19, 2013 at 8:58 PM, Ingo Karkat <swdev@...> wrote:
      > On 18-Apr-2013 16:16 +0200, glts wrote:
      >> As for the name of the variable, how about:
      >> v:motiontype
      >> The documentation says that when no motion type is given the variable
      >> will be empty, when an explicit motion type is given ("forced") it will
      >> be "v", "V", or "<C-V>". I don't think the word "force" is strictly
      >> required to make the intent of the variable clear.
      > With v:motiontype, I'd expect that to be applicable to _every_ motion,
      > not just those few special ones. I would prefer v:forcedmotiontype. The
      > only saving grace for this unreadable monster is that it's probably not
      > going to be used very much.

      I don't care too much about the name, to be frank. In the end it's
      mostly a matter of taste.

      But let me rephrase my argument in favour of v:motiontype. The docs say
      that the variable is empty when no motion type is given. Empty
      essentially means "use the default motion type". "v/V/<C-V>" means
      "override the default motion type with X-wise motion". So in any case
      the variable asserts something about the type of motion.

      Let's go with whatever people find prettiest, I'm fine with any name.

      >> What do you think?
      > I'm missing a bit where such a variable would be useful or even
      > necessary. A compelling example could avoid that we have to wait another
      > five years for inclusion :-)

      To be honest, "motion force" isn't something I use daily. Every once in
      a while I find my cursor sitting in a sweet spot and immediately see
      that dvj would finish the job, or dV{, or cvit. My concern is to allow
      custom text objects and motions to have the same capabilities as the
      built-in text objects and motions.

      Here's a good real-life example.

      The textobj-word-column.vim plugin lets you select a column (Visual
      block) of words/WORDs based on the word/WORD under the cursor. If
      v:motiontype were available, the plugin could let you do, for example,
      yVac (yank linewise a word-column), basically allowing you to yank a
      range of lines which have a vertical component in common, so to speak.
      See? Well, I think that is very useful.

      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

      You received this message because you are subscribed to the Google Groups "vim_dev" group.
      To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscribe@....
      For more options, visit https://groups.google.com/groups/opt_out.
    • Show all 6 messages in this topic