branch: elpa/evil-lisp-state
commit 0f6eefcb3e1c13b7fec39e24952ed87d968fc890
Author: syl20bnr <[email protected]>
Commit: syl20bnr <[email protected]>
Add `o` command to insert a new sexp at point on a new line below
---
README.md | 1 +
evil-lisp-state.el | 7 +++++++
2 files changed, 8 insertions(+)
diff --git a/README.md b/README.md
index f4796b31b6..8807852343 100644
--- a/README.md
+++ b/README.md
@@ -110,6 +110,7 @@ Key Binding | Function
`l` | sp-forward-symbol
`L` | sp-forward-sexp
`m` | sp-join-sexp (think about `merge-sexp`)
+`o` | switch to `insert state` and add a new line below
`p` | evil-past-after
`P` | evil-past-before
`r` | sp-raise-sexp
diff --git a/evil-lisp-state.el b/evil-lisp-state.el
index e5377d6947..3781fdd17b 100644
--- a/evil-lisp-state.el
+++ b/evil-lisp-state.el
@@ -115,6 +115,7 @@ of COMMAND.
(define-key evil-lisp-state-map "l" 'sp-forward-symbol)
(define-key evil-lisp-state-map "L" 'sp-forward-sexp)
(define-key evil-lisp-state-map "m" 'sp-join-sexp)
+(define-key evil-lisp-state-map "o" 'evil-lisp-state-insert-below)
(define-key evil-lisp-state-map "p" 'evil-paste-after)
(define-key evil-lisp-state-map "P" 'evil-paste-before)
(define-key evil-lisp-state-map "r" 'sp-raise-sexp)
@@ -142,4 +143,10 @@ of COMMAND.
(evil-end-of-line)
(eval-last-sexp nil)))
+(defun evil-lisp-state-insert-below ()
+ "Mimic `o' command for lisp state."
+ (interactive)
+ (evil-insert-state)
+ (sp-newline))
+
(provide 'evil-lisp-state)