Home:ALL Converter>vim copy into clipboard with colon cmd

vim copy into clipboard with colon cmd

Ask Time:2021-05-23T08:39:23         Author:rubotnik

Json Formatter

I want to yank multiple lines with a colon command into the UNIX-clipboard without visual mode, like this: :1,4"+y or :1,$"+y

The clipboard is active --> echo has('clipboard') returns 1

I'm on raspberry pi and tried gvim and vim. Can anybody shed some light onto this? Thank you and kind regards!

Author:rubotnik,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/67655240/vim-copy-into-clipboard-with-colon-cmd
bk2204 :

This is possible with the :yank command, which can be abbreviated :y. It takes as its argument the register without the ". So, your examples could be written as so:\n:1,4y +\n:1,5y +\n\nWhile it's possible to do this with the :normal command to do this with something like :normal 1G4"+yy, this would be a lot more complex and needlessly so. :yank is simpler and more flexible if you're fine with linewise operations.",
2021-05-23T01:27:57
yy