Vim: access to system clipboard via ssh - Linux to OS X

后端 未结 1 807
时光取名叫无心
时光取名叫无心 2021-01-01 02:41

I\'m Linux user who often needs to work on remote OS X server via SSH. I prefer vim (neovim) editor but I have problem with copy/paste to/from system clipboard via SSH. When

相关标签:
1条回答
  • 2021-01-01 03:13

    Basically, you can just open remote file on your linux machine like:

    :e scp://user@host/relative/path/from/home.txt
    

    Another solution to copy directly from ssh session would be X11 forwarding in ssh which connects system clipboard between remote and local machine.

    1. Enable X11Forwarding on the SSH server side in /etc/ssh/sshd.conf

    2. Use the -Y option for ssh client to enable it when connecting: ssh -Y your_server

    Now you can copy in the remote Vim using "*yy and paste it locally in Vim using "*p or paste it in any GUI app using Ctrl-V.

    0 讨论(0)
提交回复
热议问题