On Wednesday, November 13, 2013 11:10:39 PM UTC-5, 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.

Yes, there are plenty of ways to make custom text-objects without editing Vim.  
However, everything you've listed require the end-user list the desired objects 
ahead of time.  You could loop over the character range in a plugin or vimrc 
and make them all, or make an operator-mode mapping to a function that calls 
getchar() then tries to either make it on-the-fly or fall back to existing 
things, but all of these options get ugly fast.  Adding three lines to normal.c 
ends up being much quicker and cleaner.

-- 
-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Raspunde prin e-mail lui