[TUHS] block operations in editors, was My EuroBSDcon talk

G. Branden Robinson g.branden.robinson at gmail.com
Tue Sep 17 10:42:36 AEST 2019


At 2019-09-16T20:20:32-0400, Doug McIlroy wrote:
> Ed imposes a structure, making a (finite) file into an array, aka
> list, of lines. It's easy to define block moves and copies in a list.
> But what are the semantics of a block move, wherein one treats the
> list as a ragged-right 2D array? What gets pushed aside? In what
> direction?  How does a block move into column that not all destination
> rows reach? How do you cope when the bottom gets ragged? How about the
> top? Can one move blocks of tab-separated fields?
> 
> I think everyone has rued the lack of block operations at one time or
> another. But implementing them in any degree of generality is a
> stumbling block. What should the semantics be?

Just in case anyone didn't know, Vim has what it calls "visual block"
highlighting and operations.  CTRL-V begins one and you use the usual
movement keys to shape and size it, then an operator like (y)ank or
(d)elete.

It won't always work as one expects because of the very questions that
Doug raises above.

Vim also has characterwise blocks (begin with 'v') and linewise blocks
(begin with 'V').

The last is, more than any other single factor, what pulled me over from
traditional vi (really nvi in my case).  It was a big win over
line-counting with ":.,+n" expressions.  In retrospect I should have
been smarter and just typed ":.,/pattern/", using as /pattern/ some
short string that did not appear in any of the lines I wanted to operate
on.

Though the vi clone with the best name was, indisputably, elvis.

Regards,
Branden
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://minnie.tuhs.org/pipermail/tuhs/attachments/20190917/11cbf6a7/attachment-0001.sig>


More information about the TUHS mailing list