Last active
July 26, 2021 08:23
-
-
Save shomah4a/d17425740c8b0b8b04fcacfef85090a9 to your computer and use it in GitHub Desktop.
wsl copy paste from windows clipboard
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
;; for wsl | |
(defun wsl-copy (start end) | |
(interactive "r") | |
(shell-command-on-region start end "clip.exe")) | |
(defun wsl-paste () | |
(interactive "*") | |
(shell-command "powershell.exe -Command 'Get-Clipboard -Format Text' | sed s/\r//g" 1)) | |
(advice-add 'clipboard-kill-ring-save :before #'wsl-copy) | |
(advice-add 'clipboard-kill-region :before #'wsl-copy) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment