I'm connected to a remote machine via ssh, I can't install packages on that machine I just need to modify text files often, I'm very used to Vim but this time the remote machine only has Vi, So the registers "*y and "+y don't work to copy to clipboard, also the right click contextual menu has disabled the 'copy' option, I've been searching the internet but got nothing, can someone help me? Someone from the old good Vi editor not vim, remember I need to copy to clipboard not paste from.
Asked
Active
Viewed 187 times
1
-
By this you mean your local machine clipboard? This would depend on what client/ environment you're SSHing from – Kyle Becker Jul 18 '17 at 13:37
-
Dunno much about VI but this post said https://stackoverflow.com/questions/5532878/how-to-copy-codes-in-vi-to-clipboard "*yy" or that it might be disabled on your machine – telina Jul 18 '17 at 13:41
-
Does the terminal emulator you are sshing via not have copy and paste functionality? – Raman Sailopal Jul 18 '17 at 13:50
-
@KyleBecker, I'm on a terminal on my ubuntu local machine and sshing the remote debian machine, I don't know if it's just not possible to copy to my local clipboard but anyway if I try to copy from the remote Vi to a the same remote clipboard doesn't work too – Migdress Jul 18 '17 at 14:32
-
@telina the "*yy" copies the entire line to clipboard in Vim, in this case I need to copy to clipboard in Vi not Vim – Migdress Jul 18 '17 at 14:33
-
@RamanSailopal Yes, I can select the text dragging the cursor while left click is held and then right click the selection to click 'copy' BUT this is not what I'm looking for, but this is only if I'm sshing the remote machine from a local machine with GUI enabled, if I were on a command prompt I couldn't use the mouse so I want to know how to copy from Vi to clipboard, there is a key in my keyboard to show the contextual menu and when I select the text with 'v' in Vi and then I press the key for contextual menu, the 'copy' option is disabled – Migdress Jul 18 '17 at 14:46
-
The normal procedure for copying lines in vi is to "yank" the lines and so move the cursor to the first line of text required and then for example "5Y" to copy 5 lines. You can then move the cursor and
P to paste. I don't think it supports copying from local to remote clip boards. – Raman Sailopal Jul 18 '17 at 14:50 -
@RamanSailopal trust me, I know very well how to yank and put text withing Vi and also store text in any of the "[a-zA-Z]" registers and then paste from them within Vi, but what I need is to copy to the system clipboard to be able to paste that text in other apps in the same machine not remote, for example being able to copy text from Vi to Nano. The remote clipboard functionality is independent from that behavior. – Migdress Jul 18 '17 at 15:06
-
1@jww okay thanks for the answer I'll check – Migdress Jul 18 '17 at 15:12