2012-09-19

copy to end of line from current point

As an Emacs user, maybe you already known CopyWithoutSelection

But currently without copy to line end from current point.
Following is the my implementation, and bind to the shortcut "C-c e"




init.el

(defun copy-to-line-end (&optional arg)
  "Save point to current line end into Kill-Ring without mark (or kill and yank)"
  (interactive "P")
  (let ((start (point)))
    (save-excursion
      (end-of-line)
      (copy-region-as-kill start (point))
      )
    )
)
(global-set-key (kbd "C-c e") 'copy-to-line-end)


No comments:

Post a Comment