From f0a11c89e2ee0259096f0458343085c610c9609b Mon Sep 17 00:00:00 2001 From: Gergely Polonkai Date: Mon, 26 Sep 2016 15:37:39 +0200 Subject: [PATCH] Add open-line-{above,below} and bind them C-S-RET and C-RET now do these, respectively. --- init.el | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/init.el b/init.el index ac90123..466890f 100644 --- a/init.el +++ b/init.el @@ -452,3 +452,22 @@ Version 2016-02-16" (goto-line (read-number "Goto line: ")) (æ-restore-goto-modes old-linum-mode old-gitgutter-mode)) (æ-restore-goto-modes old-linum-mode old-gitgutter-mode)))) + +; Copied from http://whattheemacsd.com/editing-defuns.el-01.html +(defun open-line-below () + (interactive) + + (end-of-line) + (newline) + (indent-for-tab-command)) + +(defun open-line-above () + (interactive) + + (beginning-of-line) + (newline) + (forward-line -1) + (indent-for-tab-command)) + +(global-set-key (kbd "") 'open-line-below) +(global-set-key (kbd "") 'open-line-above)