vim named buffer

Example: copy  /  paste a block of text:

Put cursor on the first character of the block and set marker 'm':
mm

Move cursor to the position right after the last character of the block.
Yank from this position back to the marker 'm'  into a named buffer 'b':
"by`m
("b - defines a buffer,  y - yank command,  `m - moves to the marker)

Now move to some other place and put the buffer after the cursor:
"bp

Example: cut /paste a block of text: Put cursor on the first character of the block and set marker 'm':
mm

Move cursor to the position right after the last character of the block.
Yank from this position back to the marker 'm'  into a named buffer 'b':
"bd`m
("b - defines a buffer,  d - delete command,  `m - moves to the marker)

Now move to some other place and put the buffer after the cursor:
"bp



Comments

Popular Posts