💾 Archived View for station.martinrue.com › scientiac › e1091115b4e947699d08129f044678d2 captured on 2024-08-19 at 01:15:58. Gemini links have been rewritten to link to archived content

View Raw

More Information

⬅️ Previous capture (2023-05-24)

-=-=-=-=-=-=-

👽 scientiac

How the hell do I copy from vim to my system clipboard, I always have to launch kate and copy and do :q on kate then clear it and then launch vim and do the rest.

2 years ago · 👍 rwa

Actions

👋 Join Station

4 Replies

👽 negepezzannyitfiam

@scientiac for some reason Station stripped the plus characters from my previous comment. There should be a plus between " and y in my examples instead of a space. · 2 years ago

👽 negepezzannyitfiam

To copy into a register, you can use "<register>y<movement>

So for example, to copy the text from the cursor position to the end of the current line into the a register, you can use:

"ay$

The system clipboard is a special register called . So if you want to copy into the system clipboard, you can type:

" y$

More examples:

" yi" - copy the contents of the next quote

" yt; - copy everything from the cursor to the next semicolon

etc.

In visual mode, you can use the same pattern but you don't specify a movement (because commands operate on the current selection). So you just select what you want to copy and type " y · 2 years ago

👽 scientiac

I am using linux, I normally do :se nonu then copy by normal command then :se nu to bring back line numbering. But this is too many clicks. · 2 years ago

👽 nristen

In visual mode: " (pick register) then * (system register in mac and windows) then y (yank). "*y · 2 years ago