34165Re: Visual block question
- Dec 11, 2003
> I think it is not that simple to implement visual blockI've thought of ways to hack around it myself too, but I still can't see why
> search/replace. For set ve=all you can extend the selection
> beyond existing text - should :s treat this as spaces? What about
> matches that cross the end of visual block - should they be
> matched? I suspect learning vim regular expressions would be much
> easier than writing a patch. For example to match Pattern after
> the 15th column use
> to match after 15th virtual column use
> or to match pattern that comes rigth after "foo:"
visual block should set a range that doesn't actually match the visual
block! Does anyone think this is something that may or could be fixed? I'm
debating whether it will be easier to just do the grid editor in Emacs,
which I would prefer not to do because I like Vim a lot better. But grabbing
rectangular blocks, processing them, and having them automatically replaced
is pretty much going to be most of the work done in this thing, and the
whole purpose is to make that as fast as possible. So for example perhaps
there are 16 columns by 128 lines, one should be able to quickly select any
block of that and pass it to a command, or do a replacement, or do some
math, etc, etc. Having to repeat the process for each column will be a pain.
Visual block is nicely integrated with mouse support and key selecting.
As far as I can tell, the only thing working the way I would expect it to is
yanking, so the other hack I thought of was yanking the area to a temp
buffer, running the script on that buffer, and then putting the content from
the temp buffer back into the main one. But I would think that making Visual
Block act like a functional range indicator would be a handy feature for all
kinds of other purposes too.
Anyway, thanks everyone for all the alternate solutions, and please do let
me know if this is something that may change in future version.
- << Previous post in topic Next post in topic >>