- Run
ncopy
on your local machine, perhaps in a screen so it doesn't die - Put
npaste
into your path on the remote machine - Drop the shortcut into your
.vimrc
- When you SSH, add a reverse tunnel:
ssh <host> -R 12888:localhost:12888
- Yank and paste like a madman
Created
March 2, 2011 20:26
-
-
Save kristjan/851669 to your computer and use it in GitHub Desktop.
Yank from a remote vim into OSX's local copy buffer
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
map <Leader>y :echo system('echo -n '.shellescape(@").' \| npaste')<CR> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
while sleep .01; do nc -l 12888 | pbcopy; done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
cat - | | |
sed 's/^\s*//' | # Leading whitespace | |
sed 's/\s*$//' | # Trailing whitespace | |
sed 's/\\$//' | # Escaped newline | |
nc localhost 12888 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Netcatting through the reverse tunnel courtesy josh@gmail