Friday, December 30, 2016

Pasting from wrong register(?)

Hi,

I frequently get bugged when pasting over a visually selected block of text and the default register contains the deleted text afterwards - chances are, I want to paste the same text multiple times.

A while ago I found a convenient map to get around that by replacing the content of the default register:

`vnoremap P p:call setreg('"', getreg('0'))<CR>`

That worked fine in terminal vim 7.3 (the version in Ubuntu 14.04 LTS) but doesn't seem to work on my own machine (terminal vim 8 on ArchLinux).
Checking with `:reg "`, I see that it does indeed contain the right content, but when pasting, it appears that the contents of the last selection register `"*` is used instead - I'd need to explicitly paste from the unnamed register `""p`.

Do I misunderstand something or am I doing something wrong?

Thanks in advance

--
--
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 because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment