On Wednesday, November 13, 2013 10:10:39 PM UTC-6, Kent Sibilev wrote:
> On Wednesday, November 13, 2013 8:14:20 PM UTC-5, Daniel "paradigm" Thau 
> wrote:
> > 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
> 
> Maybe i'm missing something, but you don't need to patch Vim in order to get
> this functionality. What you need is kana's textobj pluing:
> 
> https://github.com/kana/vim-textobj-user
> 
> along with textobj-between
> 
> https://github.com/thinca/vim-textobj-between
> 
> Also you can check kana's other projects where he provides many other useful
> text objects like:
> 
> https://github.com/kana/vim-textobj-line
> https://github.com/kana/vim-textobj-indent
> etc.

While mappings are more customizable, and there is a plugin for this, C
code is faster and works in more situations. Mappings can be removed,
ignored for various commands, problems can occur while chaining them
together, complex mappings can break the undo sequence, etc.

I don't think the existence of a plugin is a good reason to avoid a
patch in this case. Text objects are one of the most powerful features
of Vim. I support making them more powerful and adding more of them. The
same arguments you make here can be used against adding ANY new text
object, even defined ones.

Relative line numbering could be done (poorly) with a plugin before the
'relativenumber' option was introduced. I'm very glad that made it into
the C code.

And Daniel's point about listing desired text-objects ahead of time is
important as well. With the exception of commas, most of the time when
I'd like a patch like this it's for something I didn't even think about
ahead of time and will probably not think of again until the next time I
need it. Stopping to make another mapping or plugin configuration, and
maybe restarting Vim, is NOT an option. I'll just do it by hand.

I certainly support this patch. I'll be applying it and running with it
a while at least to try it out. I'd love to see a better option, but this
is WAY better than nothing.

-- 
-- 
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 [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Raspunde prin e-mail lui