Created
May 17, 2020 21:07
-
-
Save naddeoa/c09c513d50efd8327ea484f994ed3d39 to your computer and use it in GitHub Desktop.
Copy from vim into system clipboard on windows subsystem for linux
This file contains hidden or 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
" Kind of hacky but it works. This just copies stuff to a file to cat it into the windows clipboard and then | |
" deletes the file so that you don't have anything risky laying around in there. | |
" fake copy current line or selection | |
noremap YY "yyy \| :call writefile( getreg('y', 1, 1), $HOME.'/.vimbuffer') \| :!cat $HOME/.vimbuffer \| clip.exe <CR> \| :!rm $HOME/.vimbuffer<CR> | |
" fake copy entire file | |
noremap <C-a> :%y y \| :call writefile( getreg('y', 1, 1), $HOME.'/.vimbuffer') \| :!cat $HOME/.vimbuffer \| clip.exe <CR> \| :!rm $HOME/.vimbuffer<CR> | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment