From 57a29c190c0ea3bd5c8a9b3835fa48d462864d5b Mon Sep 17 00:00:00 2001 From: rekado Date: Thu, 4 Dec 2014 12:10:28 +0100 Subject: add and bind smart-open-line function --- lisp/init-my-stuff.el | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'lisp') diff --git a/lisp/init-my-stuff.el b/lisp/init-my-stuff.el index 2dcc186..1c0f084 100644 --- a/lisp/init-my-stuff.el +++ b/lisp/init-my-stuff.el @@ -68,3 +68,13 @@ ;; easier way to jump to other window (global-set-key (kbd "M-o") 'other-window) + + +(defun my/smart-open-line () + "Insert an empty line after the current line. +Position the cursor at its beginning, according to the current mode." + (interactive) + (move-end-of-line nil) + (newline-and-indent)) + +(global-set-key [(shift return)] 'my/smart-open-line) -- cgit v1.2.3