branch: elpa/evil-lisp-state
commit c0b43aa30e094bfcb612834ca4165901387ff73e
Author: syl20bnr <[email protected]>
Commit: syl20bnr <[email protected]>
Add `Shift-Return` to insert new line and switch to insert state
---
README.md | 1 +
evil-lisp-state.el | 7 +++++++
2 files changed, 8 insertions(+)
diff --git a/README.md b/README.md
index 2c8b32e15c..d950905acc 100644
--- a/README.md
+++ b/README.md
@@ -173,6 +173,7 @@ Key Binding | Function
`backspace` | sp-backward-delete-char
`S-backspace` | sp-delete-char
`RET` | indent next line
+`S-RET` | insert new line char and switch to `insert state`
## Thanks
diff --git a/evil-lisp-state.el b/evil-lisp-state.el
index 2f4273aa5a..66dc4a2c2b 100644
--- a/evil-lisp-state.el
+++ b/evil-lisp-state.el
@@ -172,6 +172,7 @@ of COMMAND.
(define-key evil-lisp-state-map (kbd "<backspace>") 'sp-backward-delete-char)
(define-key evil-lisp-state-map (kbd "<S-backspace>") 'sp-delete-char)
(define-key evil-lisp-state-map (kbd "RET") 'evil-lisp-state-indent-next-line)
+(define-key evil-lisp-state-map (kbd "<S-return>")
'evil-lisp-state-new-line-insert-state)
(defun evil-lisp-state-eval-sexp-end-of-line ()
"Evaluate the last sexp at the end of the current line."
@@ -235,4 +236,10 @@ of COMMAND.
(join-line 1)
(sp-newline))
+(defun evil-lisp-state-new-line-insert-state ()
+ "Insert new line char and switch to insert mode."
+ (interactive)
+ (sp-newline)
+ (evil-insert-state))
+
(provide 'evil-lisp-state)