Saturday, December 31, 2016

Re: Pasting from wrong register(?)

I'm setting clipboard to unnamed. I can't claim to fully understand yet how this (and related) options work so I played around a bit and found that it works when I have the `exclude:` part of the default clipboard value (not /etc/vimrc). That explains why it was working on the other machine (with the same configuration) - there was no X server to share a clipboard with.

To me, it seems like the best solution is to set the clipboard to `unnamedplus` and change the map to replace the `+`-register instead of the `"`-register - using the plus instead of the star register because the star register gets overwritten when selecting the text I'm trying to replace.

Thanks and a happy new year everyone!

On 31 December 2016 at 11:54, Christian Brabandt <cblists@256bit.org> wrote:
On Fr, 30 Dez 2016, Fabian Furger wrote:

> 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?

What is your 'clipboard' setting?

Best,
Christian
--
Objektivität: Alles hat zwei Seiten. Aber erst wenn man erkennt, daß
es drei sind, erfaßt man die Sache.
                -- Heimito von Doderer

--
--
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 a topic in the Google Groups "vim_use" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/vim_use/FfKUA2Xgx_Y/unsubscribe.
To unsubscribe from this group and all its topics, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
--
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: