Index | Thread | Search

From:
"Andy Bradford" <amb-sendok-1776617303.kmgochkljgafgaiclkij@bradfords.org>
Subject:
Re: Improvement for vi(1) paste comand (updated diff)
To:
"Walter Alejandro Iglesias" <wai@roquesor.com>
Cc:
tech@openbsd.org
Date:
18 Feb 2026 09:48:23 -0700

Download raw body.

Thread
Thus said Walter Alejandro Iglesias on Wed, 18 Feb 2026 10:47:28 +0100:

> However, who  really paid attention to  all what my diff  does, surely
> noticed that I intentionally left the 'P' command untouched.

Yes, I  saw that, and  while I do  use 'P' when I  want the lines  to be
inserted before  the current line,  I don't see  why I should  change to
using 'P' all the time just to simulate an existing behavior of 'p' that
I currently get for free.

How is  this any different  from me suggesting  that you can  avoid your
hypothetical "multiple 'p'  in a row problem" by just  using 'j' to move
the cursor to  the end of your  insert so that the  cursor is positioned
where you want it?

For example, to  avoid your hypothetical problem, and  assuming you want
to yank 3 lines and paste them multiple times in a row, you could do:

3yy 2jp 2jp 2jp 2jp 2jp 2jp, etc...

I cannot remember  any time that I  ever had to do this  because of this
perceived "flaw"  in vi(1), but there you have it.

While  I  appreciate  your  desire  to contribute  code,  I'm  just  not
convinced that the efforts are  worth the fallout, especially since it's
not really  proven that this is  a bug in behavior---I  would definitely
have  to  relearn  some  old  habits  and for  what?  Simply  to  do  it
differently? Also, I  checked implementations on FreeBSD,  AIX and HP-UX
and vi(1)'s behavior is consistent with those.

If I wanted  a "modern" or "different"  vi, I would use vim,  but so far
the feature  set in vi(1)  is sufficient for  my needs and  I'm actually
discovering that vi(1) can  do more than I even realized  the more I use
it. Case  in point is  the 't'  command which in  all these years  I had
never had occasion to use until recently.

Thanks for your discussion,

Andy