Of buffers


Previous Index Next



vi keeps a number of buffers including the current one.

yYank to buffer
pPull from buffer to after cursor
PPull from buffer to before cursor

Any of those commands can be prefixed with "id Where the ID specifies a particular buffer. Pulling from a buffer does not empty it - you can pull multiple times to copy something.

Numbered buffers

Deletion actually copies to one of the numbered buffers. Last deleted block goes to buffer 1, one before that buffer 2 etc.

"1pRecover the last deleted block
"1p....Repeat the pull - special case on number buffered, goes back to previous ones

Alphabetic buffers

A series of buffers for your own use exist labelled a-z. Useful tricks include:

    "aY
    :e anotherfile
    "ap
To copy between files.

Buffers are also where good deep vi macros are built using the @buffer id command.


Copyright Dr. David Alan Gilbert 2001. vitalk @ treblig.org - Hacked together with dsh