diff options
| author | yuzu-eva <stevenhu@web.de> | 2023-10-28 22:05:28 +0200 |
|---|---|---|
| committer | yuzu-eva <stevenhu@web.de> | 2023-10-28 22:05:28 +0200 |
| commit | c3dd2dc1ca1ddf3771d1bbc733fd7aa3e8c6835d (patch) | |
| tree | 695ae9ba057728eea74fe5821c677ada09bb845a | |
| parent | 02082e0ab611d4b3c4a26a71d93260860254cdbb (diff) | |
feature: added function to insert newline above/below similar to vim
| -rw-r--r-- | config.org | 22 |
1 files changed, 22 insertions, 0 deletions
@@ -426,6 +426,28 @@ Taken from [[http://xahlee.info][Xah Lee]]. (re-search-forward (regexp-opt xah-right-brackets) nil t)) #+end_src +** Insert newline above/below + +Inserts a newline above or below, like O and o in vim + +#+begin_src emacs-lisp + (defun newline-above () + "Inserts a new line above current line and moves cursor to that position" + (interactive) + (beginning-of-line) + (newline-and-indent) + (previous-line) + (indent-relative)) + (global-set-key (kbd "M-O") 'newline-above) + + (defun newline-below () + "Inserts a new line below current line and moves cursor to that position" + (interactive) + (end-of-line) + (newline-and-indent)) + (global-set-key (kbd "M-o") 'newline-below) +#+end_src + * Use-Package section ** Initialize =dashboard= |
