aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordx <aryadevchavali1@gmail.com>2020-05-25 01:50:51 +0100
committerdx <aryadevchavali1@gmail.com>2020-05-25 01:50:51 +0100
commit8f8f39ab2430489000bb1d84a07e83263b301f1a (patch)
treebb2d1000496a9001cc8040ebed302566160b62a4
parent727c133c26d4c9696fe295208579a2d967773be0 (diff)
downloaddotfiles-8f8f39ab2430489000bb1d84a07e83263b301f1a.tar.gz
dotfiles-8f8f39ab2430489000bb1d84a07e83263b301f1a.tar.bz2
dotfiles-8f8f39ab2430489000bb1d84a07e83263b301f1a.zip
+binding to open newlines without using o/O
-rw-r--r--Doom/.doom.d/org/config.org11
1 files changed, 11 insertions, 0 deletions
diff --git a/Doom/.doom.d/org/config.org b/Doom/.doom.d/org/config.org
index f4d198e..06a3edf 100644
--- a/Doom/.doom.d/org/config.org
+++ b/Doom/.doom.d/org/config.org
@@ -570,8 +570,19 @@ General keymap
#+END_SRC
*** Non-leader
#+BEGIN_SRC elisp
+(defun dx:newline (&optional BACKWARD)
+ (interactive)
+ (message "%s" BACKWARD)
+ (let ((old (point)))
+ (cond ((and BACKWARD (= BACKWARD 1)) (+default/newline-above))
+ (t (+default/newline-below)))
+ (goto-char (+ old 1))
+ (evil-normal-state)))
+
(map!
:n "TAB" #'evil-jump-item
+ :n "M-v" #'dx:newline
+ :n "M-V" #'(lambda () (interactive) (dx:newline 1))
:v "M-c" #'count-words-region
:n "M-s" #'occur)
#+END_SRC