💾 Archived View for station.martinrue.com › scientiac › e1091115b4e947699d08129f044678d2 captured on 2023-07-22 at 18:11:44. Gemini links have been rewritten to link to archived content
⬅️ Previous capture (2023-05-24)
-=-=-=-=-=-=-
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
@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
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
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
In visual mode: " (pick register) then * (system register in mac and windows) then y (yank). "*y · 2 years ago