Last active
January 8, 2018 16:44
-
-
Save RishiSadhir/7848741 to your computer and use it in GitHub Desktop.
Quick emacs function to copy the current line.
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
(defun copy-line (arg) | |
"Copy lines (as many as prefix argument) in the kill ring" | |
(interactive "p") | |
(kill-ring-save (line-beginning-position) | |
(line-beginning-position (+ 1 arg))) | |
(message "%d line%s copied" arg (if (= 1 arg) "" "s"))) | |
;; optional key binding | |
(global-set-key "\C-c\C-k" 'copy-line) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment