NetBSD-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: stupid question on vi



adr <adr%sdf.org@localhost> wrote:

> On Sun, 23 Feb 2025, beaker wrote:
> > I'm not seeing the Ctrl-X thing on NetBSD 9.3, though maybe that's
> > the poorly documented aspect..
>
> It's there since (at least) 1997:
> https://docs-archive.freebsd.org/44doc/usd/13.viref/paper.pdf

So why is it not in the :viusage listing after all this time?


> > The OP should be able to use named buffers for this task.
> >
> > Steps:
> > 1) create lines with the commands you want to run:
> >  /\x93        # vi cmd: find/search forward in file for "\x93"
> >  :%s/\x93//g  # ex cmd: globally replace all instances of "\x93" w/ ""
> >
> > 2) move to each line and yank into a separate named buffer:
> >  "fyy  # => sticks '/\x93' into buffer 'f'
> >  "gyy  # => sticks ':%s/\x93//' into buffer 'g' (global replace)
> >
> > 3) execute buffers as needed:
> >  @f    # => runs buffer 'f' ; use '/' and/or 'N' to repeat, 'x' to delete
> >  @g    # => runs buffer 'g' ; one-shot global substitution
>
> I'm sorry but this is nonsense.  You are searching and replacing
> the string "x93".

The OP literally said he wanted to do a search & replace; that's what
the 'g' named buffer example does.

Sorry if you are confused.


Home | Main Index | Thread Index | Old Index