Copying to your clipboard over SSH in vim with OSC52

submited by
Style Pass
2024-11-21 21:30:03

I have my local vim set up to integrate with my system clipboard (so that p pastes from my system clipboard etc), but I thought it was impossible to do the same thing over SSH. It turns out that actually it is possible with an ANSI escape sequence called OSC52! A few links:

Dmitry Mazin also told me you can create this script on a remote host, call it pbcopy, and piping into it will copy to your clipboard! I tested it and it works.

Leave a Comment