summaryrefslogtreecommitdiff
path: root/.config/emacs/editing.el
diff options
context:
space:
mode:
authorThomas Voss <mail@thomasvoss.com> 2024-10-19 17:06:43 +0200
committerThomas Voss <mail@thomasvoss.com> 2024-10-19 17:06:43 +0200
commit1effee8ec18d810ba21c208c42cd8ba6b3c24391 (patch)
tree74e2fcb931fa6c5ff4929a19f2ff71dd87d7b5af /.config/emacs/editing.el
parentb069e5523ea03ca9c33040681d9844932b5d4da8 (diff)
emacs: Add e/open-line
Diffstat (limited to '.config/emacs/editing.el')
-rw-r--r--.config/emacs/editing.el12
1 files changed, 12 insertions, 0 deletions
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)