On 09/22/2011 10:37 AM, Ben Fritz wrote:


On Sep 21, 6:44 pm, AK<andrei....@gmail.com>  wrote:
Is there a plugin to complete a text object?

e.g. where | is cursor:

"one two" "three four""<c-x><c-z>

"one two" "three four" "three four"

"one two" "three four" "o<c-x><c-z>

"one two" "three four" "one two"

And the same thing for other text objects, of course?

What other neat things might be done with text objects, in theory (I'm
thinking of ideas for a new plugin)?


It looks like you're trying to complete strings. I don't know of a
plugin to do that, but your subject is more interesting to me than
your example, because Vim supports a variety of text-objects


Of course, I didn't want to give examples for all text objects, I
hoped it's enough to give one example. I was mostly thinking about
', " strings and xml tags, because sentences and paragraphs would
be harder to disambiguate... maybe code blocks too, but I mostly
use python and python functions are not official text-objects
anyway.

(see :help text-objects) such as sentences, paragraphs, code blocks,
xml-style tags, words, WORDs, strings with ", strings with ', and
more. I think it would be really neat to be able to complete any of
these...but probably fairly difficult to accomplish, especially with
an acceptable level of performance. Maybe if it were limited to a very
small number of buffers (current buffer only? visible buffers only?).


I was definitely thinking of current buffer only, and maybe even limited
to some small number of preceding / following text objects. Like 5 or 10. That'd be enough to be very useful.

  -ak

--
You received this message from the "vim_use" 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

Reply via email to