From a24426ce1832bd28ae1030c035db70fbc1d6751b Mon Sep 17 00:00:00 2001 From: Gergely Polonkai Date: Tue, 16 Feb 2016 09:12:19 +0100 Subject: [PATCH] Create defun duplicate-line --- init.el | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/init.el b/init.el index 64b89fc..a18792d 100644 --- a/init.el +++ b/init.el @@ -268,6 +268,18 @@ (setq protocopy-end (point)) (kill-ring-save protocopy-begin protocopy-end))) +(defun duplicate-line() + (interactive) + (save-excursion + (move-beginning-of-line 1) + (kill-line) + (yank) + (open-line 1) + (next-line 1) + (yank))) + +(global-set-key (kbd "C-c C-y") 'duplicate-line) + (add-to-list 'auto-mode-alist '("\\.vala\\'" . vala-mode)) (add-to-list 'auto-mode-alist '("\\.erl\\'" . erlang-mode)) (add-to-list 'auto-mode-alist '("\\.yml\\'" . yaml-mode))