Groups | Search | Server Info | Login | Register


Groups > comp.editors > #106863

Re: Vi: is there any way not to yank text I'm deleting?

From gazelle@shell.xmission.com (Kenny McCormack)
Newsgroups comp.editors
Subject Re: Vi: is there any way not to yank text I'm deleting?
Date 2026-02-17 14:08 +0000
Organization The official candy of the new Millennium
Message-ID <10n1so1$1mqpa$1@news.xmission.com> (permalink)
References <10n027u$187f4$1@dont-email.me> <10n031b$18euo$1@dont-email.me> <10n05li$3tuuv$2@dont-email.me> <10n1ham$1mgl9$1@dont-email.me>

Show all headers | View raw


In article <10n1ham$1mgl9$1@dont-email.me>,
Anthony Howe  <achowe@snert.com> wrote:
>On 2026-02-16 17:28, Janis Papanagnou wrote:
>>> Use "_dd and similar to not put the deleted text in a register.
>>> See :h "_
>> 
>> Do you know whether that register was existing in classical Vi ?
>> (I don't think so but, frankly, I don't recall and I'm curious.)
>
>The "a .. "z and "1 .. "9 buffers are part of historical `ex` and `vi`,
>see SUS https://pubs.opengroup.org/onlinepubs/9799919799/ buffer
>definition.

But that's not Janis's question.  The question is whether or not classical
vi has the "_" (black hole) register.  And the answer to that is No.

>I used to work on Mortice Kern Systems maintaining their DOS `vi` while we
>were balloting POSIX.2. The named buffers were part of the historical `vi`
>and the MKS independent clone.

Right.  But since we are in this general area and not to change the subject
but to change the subject, let me add that I have never been able to figure
out the logic of the numbered buffers.  I've never seen a good explanation
of why they are there and how you might use them to your benefit.  And
every time I've tried to use them, things are not where I expect them to
be.  That is, when I do the "registers" command (in Vim), the contents of
the numeric buffers always seems random/unpredictable to me.

>As for the OP, deleting / changing always included a yank into the numeric 
>buffers.  That is historical behavior and documented in SUS.

Yeah, but which one - and for how long?

Anyway, it is not clear what OP is actually concerned about.   Why should
one care about whether or not yanking puts text into the (unnamed) buffer
or not?  Is it an efficiency concern (in which case, it is almost certainly
an unnecessary concern) or is about wiping out something that you wish to
keep?  (If the later, then you should, as detailed upthread, store it into
some other register.  That's what I do; if I think I may later need what I am
yanking or deleting, then I yank/delete it into a named register [*]).

[*] Which, of course, also puts it into the unnamed register.

-- 
A racist, a Nazi, and a Klansman walk into a bar...

Bartender says, "What will it be, Mr. Trump?"

Back to comp.editors | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

Vi: is there any way not to yank text I'm deleting? swapjim <swapjim@example.org> - 2026-02-16 23:29 +0200
  Re: Vi: is there any way not to yank text I'm deleting? Rene Kita <mail@rkta.de> - 2026-02-16 21:43 +0000
    Re: Vi: is there any way not to yank text I'm deleting? Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2026-02-16 23:28 +0100
      Re: Vi: is there any way not to yank text I'm deleting? Rene Kita <mail@rkta.de> - 2026-02-17 07:42 +0000
      Re: Vi: is there any way not to yank text I'm deleting? Anthony Howe <achowe@snert.com> - 2026-02-17 05:53 -0500
        Re: Vi: is there any way not to yank text I'm deleting? gazelle@shell.xmission.com (Kenny McCormack) - 2026-02-17 14:08 +0000
          Re: Vi: is there any way not to yank text I'm deleting? Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2026-02-17 17:41 +0100
  Re: Vi: is there any way not to yank text I'm deleting? Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2026-02-16 23:20 +0100
  Re: Vi: is there any way not to yank text I'm deleting? Jason H <jason_hindle@yahoo.com> - 2026-02-17 22:42 +0000
    Re: Vi: is there any way not to yank text I'm deleting? Jason H <jason_hindle@yahoo.com> - 2026-02-17 22:49 +0000
  Re: Vi: is there any way not to yank text I'm deleting? Geoff Clare <geoff@clare.See-My-Signature.invalid> - 2026-02-18 13:34 +0000

csiph-web