Add open-line-{above,below} and bind them

C-S-RET and C-RET now do these, respectively.
This commit is contained in:
Gergely Polonkai 2016-09-26 15:37:39 +02:00
parent 567b909791
commit f0a11c89e2
1 changed files with 19 additions and 0 deletions

19
init.el
View File

@ -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 "<C-return>") 'open-line-below)
(global-set-key (kbd "<C-S-return>") 'open-line-above)