I have found lots of questions about coping content of a file in Vim
from one file to another and of course there are various ways to do it (1-2). I'm working on a remote machine and I'm going to copy large amount of data from a file in Vim to my laptop. None of the methods I have found yet works for coping from a remote machine. I have to use scp
for any thing that I need from the remote machine. Do you have any idea?
Asked
Active
Viewed 472 times
0
2 Answers
1
I can't use
"*100yy
to copy content and remote machine does not have any graphical editor. – Abolfazl
Naturally, if the editor has no notion of a GUI or a window system, it cannot use the clipboard, let alone that of your networked laptop. One option is to use the copy function of the local terminal program where you enter ssh
, but of course that is practically limited by the terminal size.
If your laptop runs Windows, I recommend using WinSCP
instead of ssh
and the remote vim
- you can configure WinSCP
to edit the remote file with your local gvim
, with all its features.

Armali
- 18,255
- 14
- 57
- 171
0
In your terminal:
$ man ssh
/-X

romainl
- 186,200
- 21
- 280
- 313
-
I didn't get `bash: syntax error near unexpected token `newline'` – Abolfazl Dec 09 '15 at 20:44
-
`
` is the return/enter key. I'll just remove that. – romainl Dec 09 '15 at 20:49 -
when I ssh with -X I can't use "*100yy to copy content and remote machine does not have any graphical editor. – Abolfazl Dec 09 '15 at 21:05