0

vim1 is my local vim.vim2 is the remote vim.

ssh root@remote_ip
vim 
#it is vim2

Now some content in my vim1's + register.

curl -X POST https://content.dropboxapi.com/2/files/upload \
        --header "Authorization: Bearer xxxx" \
        --header "Dropbox-API-Arg:  {\"path\":\"/test.txt\",\"mode\":{\".tag\":\"overwrite\"}}" \
        --header "Content-Type: application/octet-stream" \
        --data-binary @"test.txt"

I want to copy content in my vim1's + register into my vim2.

1.To input ctrl+shift+v in vim2 will get bad formatted content.

curl -X POST https://content.dropboxapi.com/2/files/upload \
                    --header "Authorization: Bearer xxxx" \
                                --header "Dropbox-API-Arg:  {\"path\":\"/test.txt\",\"mode\":{\".tag\":\"overwrite\"}}" \
                                            --header "Content-Type: application/octet-stream" \
                                                        --data-binary @"test.txt"

2.To input :"+p in vim2 can't do the trick.

How to copy content in + register from local vim to remote vim in good format?

  • Did you know you can open the remote file in your local vim? You could just paste the registry contents directly that way. Putting that aside, if you enter :set paste in the remote vim and then paste your text does it help? – B Layer Apr 15 '18 at 8:01
  • Use paste mode together with Ctrl-shift-insert. Alternatively, there should be a way to forward the X-Connection and make use of the clipboard. But that is usually tricky to setup. – Christian Brabandt Apr 18 '18 at 5:51
1

I think it is pasting that messes the format. Have you tried :set paste before ctrl+shift+v in the remote vim?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.