From: patrick keshishian Subject: Re: Improvement for vi(1) paste comand (updated diff) To: Andy Bradford Cc: Walter Alejandro Iglesias , tech@openbsd.org Date: Wed, 18 Feb 2026 11:10:33 -0800 Hi, On Wed, Feb 18, 2026 at 8:50 AM Andy Bradford < amb-sendok-1776617303.kmgochkljgafgaiclkij@bradfords.org> wrote: > 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... > Or in this case, since you are pasting the same lines over and over, can avoid the 2j part and use P. For what it's worth, and I am not sure if my opinion counts all that much here, I do agree with Andy Bradford. When I paste something using the p command, I usually intend to edit the lines. Therefore leaving the cursor at the current location is what I expect. 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. This is also true with my experience with base vi. I keep reading about features which I wasn't aware while reading these discussion threads. Cheers, --patrick > > Thanks for your discussion, > > Andy > >