Operating System - HP-UX
1756915 Members
3575 Online
108857 Solutions
New Discussion юеВ

Re: What is vi command to place contents of markers in a named buffer?

 
SOLVED
Go to solution
Jack C. Mahaffey
Super Advisor

What is vi command to place contents of markers in a named buffer?


I'm trying to figure out how to place the contents of two markers in a named buffer. I can get the unnamed buffer to be used. I want to use a named buffer.

The following yanks the contents of two buffers into the unnamed buffer.

'ay'b

I tried 'ayay'b and it doesn't work.

Is it possible to copy the contents of the unnamed buffer to a named buffer.

Thanks... jack..
8 REPLIES 8
Ron Kinner
Honored Contributor

Re: What is vi command to place contents of markers in a named buffer?

The trick to playing with the named buffers is to put a double quote and then the buffer letter at the beginning of the command. At least that's what my AT&T VI reference from 1984 says.

"ayy

would copy the current line to buffer a.

To move from the unnamed to a named buffer a you would do:

"ap

Ron
H.Merijn Brand (procura
Honored Contributor
Solution

Re: What is vi command to place contents of markers in a named buffer?

> I'm trying to figure out how to place the contents of two markers in a named buffer. I can get the unnamed buffer to be used. I want to use a named buffer.

'a"ay'b

will put the content of everything between mark a ('a) and mark b ('b) into buffer a ("a)

> Is it possible to copy the contents of the unnamed buffer to a named buffer.

no, not without putting the unnamed buffer in the file first. But you can do

Gp"adG

Go to end of file, put the contents of the unnamed buffer there, and delete what you've just put there into buffer a
Enjoy, Have FUN! H.Merijn
BFA6
Respected Contributor

Re: What is vi command to place contents of markers in a named buffer?

I use ma to mark the start of the section I want to yank.
Move to the last +1 line then do "ay'a to yank the lines into the buffer a

Edit a new file and use "ap to put the yanked lines into the new file.

Hilary
Jack C. Mahaffey
Super Advisor

Re: What is vi command to place contents of markers in a named buffer?

I want to used the marker delimiters that I have previously defined.

Ex:

Position cursor on start line
ma

Position cursor on last line
mb

Now place the contents of marker a and marker b into buffer c

'ay'b works for the default buffer

I would like to be able to then paste the contents of buffer c later in the file,
ex: "cp

jack...
Jack C. Mahaffey
Super Advisor

Re: What is vi command to place contents of markers in a named buffer?

The example
'a"ay'b
is exactly what I'm looking for. I was missing the double quotes.

Thanks to all... jack...
Scott Williams_5
Frequent Advisor

Re: What is vi command to place contents of markers in a named buffer?

F.Y.I on my HP-UX box you can use this syntax: 'a,'by a

H.Merijn Brand (procura
Honored Contributor

Re: What is vi command to place contents of markers in a named buffer?

Scott, you are right if you enter ex mode (with :), but the original question was obviously about interactive (visual) mode
Enjoy, Have FUN! H.Merijn
Jack C. Mahaffey
Super Advisor

Re: What is vi command to place contents of markers in a named buffer?

Thanks for the corresponding ex commands, they will also be useful. :) jack...