Skip to content

Instantly share code, notes, and snippets.

@kristjan
Created May 30, 2013 01:25
Show Gist options
  • Save kristjan/5675218 to your computer and use it in GitHub Desktop.
Save kristjan/5675218 to your computer and use it in GitHub Desktop.
A clever way to copy from a remote vim session to your local system clipboard
Host my.remote.host
RemoteForward 12888 localhost:12888
map <Leader>y :echo system('echo -n '.shellescape(@").' \| npaste')<CR>
#!/bin/bash
while sleep 0.1; do nc -l 12888 | pbcopy; done
#!/bin/bash
[ "$*" ] && cat $* | nc localhost 12888 || nc localhost 12888
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment