On Thursday, November 14, 2013 6:24:42 AM UTC-5, Daniel "paradigm" Thau wrote:
> On Wednesday, November 13, 2013 11:10:39 PM UTC-5, Kent Sibilev wrote:
> > 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
> 
> 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.

With textobj-between plugin installed you don't need to loop over and make a 
mapping for every possible character. The plugin adds a single text object 
activated by pressing 'f'. So if you want to delete a content between to 
underscores (_) characters, you press dif_. If you want change text between two 
dollar sign characters you press cif$, etc.

Also I don't understand how the aforementioned fallback would work in practice. 
For example, if I edit an html content <h1>aat....tbb</h1> and my cursor is on 
one of the dot characters. Is it true that pressing dit would delete only dots 
characters instead of all tag's content?

-- 
-- 
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.

Reply via email to