On 4/28/06, Gary Johnson <[EMAIL PROTECTED]> wrote:
On 2006-04-28, Eric Arnold <[EMAIL PROTECTED]> wrote:
> I've created a more sophisticated version of this for Vim7.  It does a
> pretty good job of maintaining a rectangle while allowing normal
> editing.   I've uploaded it to sourceforge as Edit_Visual_Block.vim .

I guess I'm not sure what this does.  I tried using it to edit the
contents of some table cells, but it moves the right limit of the

Is is supposed to allow normal editing (with all completion, pasting,
etc.) where the border is contained.  Most other Visual Block commands
only allow repeating characters or complete replacement of the area.

selected region when I use cw to change a word.  Also, it doesn't

I haven't really settled on what is the correct behavior in all cases.

Per your original request, it moves the right border in real time as
you add characters.  As for "cw", it looks like in many cases it is
considering the new text as "added".  If you use "R", you'll notice
that it doesn't move the border.  Also, "dw" doesn't move the border,
as I think you want it to, unless you are shrinking the longest line,
or all lines have spaces at the end.

I'll have to think of what to do about "cw".  The problem is how to
distinguish spaces that are added which are desired which *should*
grow the border, and spaces which are not.  Also, "cw" only grows the
area if some other line is longer, and is holding the border
(unfortunately, the longer line can include trailing spaces).  If you
"cw" a word on the longest line, it will shrink the area first.

I had it set at first so "cw" didn't grow the area, but then there was
the problem of how to grow the area with spaces when you wanted to.

If you have any ideas or descriptions of how it should work, let me know.


seem to allow reflowing of text (gq).  So it doesn't seem to allow
anything I can't do with normal vim commands.  What am I missing?

Unfortunately, "gq" operates on whole lines as far as I can tell.


Aside from that, I really like that you included a test for version.
I have an NFS-mounted HOME directory and not all the computers I use
have vim 7 installed yet.

One more thing:  since your script uses tabstops of 4, it would be
nice if you included a modeline such at this,

    " vim: ts=4 sw=4

at the bottom of the script.

Good idea.

Reply via email to