Sunday, October 14, 2012

Re: Replacing current line with last-yanked register

If you yanked the line then it is still in the 0 register. You can paste
from it. Though this will be four keystrokes: V"0p

If you do that often you could use a map:

vnoremap P "0p

and then there are only two keystrokes: VP

Best,
Marcin


On 12:38 Sun 14 Oct , Dotan Cohen wrote:
> I am currently using Vp to replace the current line with the
> last-yanked register (usually populated by simply Y on another line).
> However, these two disadvantages are apparent:
> 1) This can only be done once. After pasting, the last-yanked register
> becomes the text of the replaced line.
> 2) This operation cannot be repeated with the '.' key.
>
> Is there a simple (no more than two or three keystrokes) way to
> replace the current line with last-yanked register, in a manner that
> does not have one or both of the disadvantages stated above?
>
> Thanks!
>
> --
> Dotan Cohen
>
> http://gibberish.co.il
> http://what-is-what.com
>
> --
> You received this message from the "vim_use" maillist.
> Do not top-post! Type your reply below the text you are replying to.
> For more information, visit http://www.vim.org/maillist.php

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

No comments: