From 1effee8ec18d810ba21c208c42cd8ba6b3c24391 Mon Sep 17 00:00:00 2001 From: Thomas Voss Date: Sat, 19 Oct 2024 17:06:43 +0200 Subject: emacs: Add e/open-line --- .config/emacs/editing.el | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to '.config/emacs/editing.el') diff --git a/.config/emacs/editing.el b/.config/emacs/editing.el index 1920c91..f635705 100644 --- a/.config/emacs/editing.el +++ b/.config/emacs/editing.el @@ -144,4 +144,16 @@ screen after scrolling." (interactive) (mm-do-and-center #'cua-scroll-up)) +(defun e/open-line (arg) + "Insert and move to a new empty line after point. +With prefix argument ARG, inserts and moves to a new empty line before +point." + (interactive "P") + (end-of-line) + (newline-and-indent) + (when arg + (transpose-lines 1) + (previous-line 2) + (end-of-line))) + (provide 'editing) -- cgit v1.2.3