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

Patch to utilize undefined text-objects

Expand Messages
  • Daniel Thau
    Attached is a patch to add an autotextobject setting which will treat undefined text-objects like quote text objects, using the provided character as bounds.
    Message 1 of 57 , Nov 13, 2013
    • 0 Attachment
      Attached is a patch to add an 'autotextobject' setting which will treat
      undefined text-objects like quote text objects, using the provided
      character as bounds.  For example, with this setting if a user enters
      "di," with the cursor between two commas, the text between the commas
      will be removed.  This is very useful for editing lists.  Similarly, if
      one is composing TeX being able to quickly operate on the area between
      dollar signs is useful.  If one is editing snake_case_variables, being
      able to do a quick "ci_" is also nice.  The key here is that it happens
      on-the-fly with all as-of-yet-undefined objects without requiring the
      user consider every possible character he/she would be interested in
      ahead of time.

      Outside of documentation and adding the setting itself, the it is only a
      few additional lines of code.

      I've wanted this feature for a while; if there is anything else I should
      do to help get it upstreamed do let me know and I'll see what I can do.

      - Daniel Thau

      --
      --
      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.
    • Ben Fritz
      ... That patch still applies in 7-4-256, minus a small tweak to the src/testdir/Makefile. I think I characterized the visual mode issue a little better. It
      Message 57 of 57 , Apr 11, 2014
      • 0 Attachment
        On Thursday, March 27, 2014 12:05:08 PM UTC-5, Ben Fritz wrote:
        >
        > I tried updating this patch for 7-4-220 and mostly succeeded, just by applying a couple hundred lines of fuzz, but visual mode is not selecting the full text inside the matched pairs. I don't have time to try to fix it further. I'm attaching the updated patch in case I just did something wrong. I know there have been some visual mode changes outside of this patch between now and the time the patch was created.

        That patch still applies in 7-4-256, minus a small tweak to the src/testdir/Makefile. I think I characterized the visual mode issue a little better. It appears to only expand the visual selection to the right, it does not move the left side.

        Example, with text "I like to eat apples" I can place the cursor on the first "p" of apples and type "vime". This selects from that p up to just before the "e" in apples. If the cursor is on the "t" in "eat" instead, vime will select from the t to the "e" in apples. With the cursor on the "a" in "eat" the full text is selected. Using "vame" is similar, the full text is only selected if I place the cursor on the "e" in "eat". The selection always starts from the cursor location.

        --
        --
        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/d/optout.
      Your message has been successfully submitted and would be delivered to recipients shortly.