Skip to content

Instantly share code, notes, and snippets.

@zkat
Last active October 12, 2015 19:27
Show Gist options
  • Select an option

  • Save zkat/4075454 to your computer and use it in GitHub Desktop.

Select an option

Save zkat/4075454 to your computer and use it in GitHub Desktop.
mouse-copy keyboard-based replacement
;; Somewhat similar to mouse-copy functionality, but no rat involved
(defun save-current-point ()
(interactive)
(point-to-register 'p)
(message "Current point saved"))
(defun load-last-point ()
(interactive)
(jump-to-register 'p))
(defun yank-to-last-point-and-indent ()
(interactive)
(load-last-point)
(yank)
(paredit-backward)
(indent-sexp))
;; Suggested bindings
(global-set-key (kbd "C-M-s") 'save-current-point)
(global-set-key (kbd "C-c p") 'load-last-point)
(global-set-key (kbd "C-M-y") 'yank-to-last-point-and-indent)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment