Friday, March 3, 2023

Re: Can I copy/yank into and out of vim?

On 2023-03-03 16:08, K otgc wrote:
> Hello, I would like to copy/yank text from vim out to other programs
> like dpaste or Google Docs.

How you go about this depends on a couple factors that you omit:

- which OS are you using?

- do you mean via the clipboard (in which case, if your build was
built with clipboard support, you can use the "*" or "+" register
which are the same thing on Windows & MacOS, but are different on
X) or do you mean operating via some interface/API? And if you
intend to use the system clipboard, does your vim have clipboard
support built in? (look for "+clipboard" or "+xterm_clipboard" in
the output of ":version")

- are you only doing linewise selections in vim, or are you trying
to deal with characterwise and blockwise visual selections, too?

> I would also like to coy/yank text from external programs like website
> text into vim.

Solutions here would require answers to the above questions, too

> I can manually highlight external program text with my mouse, copy and
> then insert into vim, but maybe there's a vim script for this?

If using the clipboard register doesn't suffice, you might have to
detail whether you mean the Selection mode or Visual mode. And
possibly include your 'mouse' settings:

:set mouse?

(to help determine whether the selection is being handled by your
terminal or by vim)

-tim






--
--
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/ZAKe%2BCmlQUxzK1qd%40thechases.com.

No comments:

Post a Comment