Skip to content

Instantly share code, notes, and snippets.

@nabinno
Created August 28, 2014 14:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nabinno/baf7143f9469d4f32057 to your computer and use it in GitHub Desktop.
Save nabinno/baf7143f9469d4f32057 to your computer and use it in GitHub Desktop.
(global-set-key "\C-cw" 'cb-copy)
(global-set-key "\C-cy" 'cb-paste)
(defun cb-copy ()
(interactive)
(let ((coding-system-for-write 'shift_jis-dos))
(shell-command-on-region (region-beginning) (region-end) "cat > /dev/clipboard" nil nil nil))
(message ""))
(defun cb-paste ()
(interactive)
(let ((coding-system-for-read 'shift_jis-dos))
(goto-char
(+ (point) (cadr (insert-file-contents "/dev/clipboard"))))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment