Tuesday, August 6, 2019

Re: Persist Clipboard after Exiting Vim

On Tue, Aug 6, 2019 at 10:59 AM Michael Partridge <mcp292@nau.edu> wrote:
>
> Is there a way to prevent the clipboard buffer from being cleared upon exit?
>
> I am using the 'gvim' package on Archlinux. My terminal is suckless st.
>
> The behavior I'm looking for is to use the system clipboard for yank, etc. procedures. I have achieved this by putting 'set clipboard=unnamedplus' in my config file. This puts yanked content into my system clipboard where I can Ctrl (+ Shift) + V the content anywhere else in my window-space, until I close Vim, at which point the buffer gets cleared.
>
> I have noticed that paste 'p' still works between Vim files after closing, which makes it seem like the content is still in the buffer, but then why isn't it accessible via Ctrl (+ Shift) + V?
>
> An example of use: take content from a Vim file and paste it into another application.
>
>
> MCP

See (for Linux) ":help x11-cut-buffer". As you said, another Vim can
still fetch the copied data from there. However not every non-Vim
application is even aware of the existence of X11 cut-buffers. For
many non-Vim applications, Edit→Paste (or Ctrl-V) uses the X11
clipboard (Vim's + register), <MiddleMouse> uses the selection (Vim's
* register), and that's that.

Using Ctrl+Shift+V in konsole uses konsole's pasting mechanism, a Vim
running in konsole sees nothing; xterm is not even aware of the X11
clipboard and uses only the <MiddleMouse> selection. Ctrl-V in Vim
itself is not used to paste, but either (a) in Normal mode, to start
Block-Visual, see ":help CTRL-V", or (b) in Insert and Command-line
mode, to insert a character literally, see ":help c_CTRL-V", ":help
i_CTRL-V" and ":help i_CTRL-V_digit".

Best regards,
Tony.

--
--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/CAJkCKXuXtjG%3Daf%3DMWZCutQ%3DbVZCzNVzhGKihRUSzycp5AMLwUw%40mail.gmail.com.

No comments:

Post a Comment