branch: elpa/evil-lisp-state
commit 0ddcc908e847ca1f371a2023f6e83cdd846aec5c
Author: syl20bnr <[email protected]>
Commit: syl20bnr <[email protected]>
`RET` is for indent next line
---
README.md | 3 ++-
evil-lisp-state.el | 8 +++++++-
2 files changed, 9 insertions(+), 2 deletions(-)
diff --git a/README.md b/README.md
index a3f5e29a6e..2c8b32e15c 100644
--- a/README.md
+++ b/README.md
@@ -111,6 +111,7 @@ Key Binding | Function
`d` | evil-delete
`h` | next char
`i` | evil-insert-state
+`I` | evil-insert-line
`j` | next visual line
`k` | previous visual line
`l` | next char
@@ -171,7 +172,7 @@ Key Binding | Function
`<tab> y` | sp-backward-copy-sexp
`backspace` | sp-backward-delete-char
`S-backspace` | sp-delete-char
-`RET` | sp-newline (stay in `lisp state` see `o` to switch to `insert
state`)
+`RET` | indent next line
## Thanks
diff --git a/evil-lisp-state.el b/evil-lisp-state.el
index 37b2e99d46..e833241489 100644
--- a/evil-lisp-state.el
+++ b/evil-lisp-state.el
@@ -171,7 +171,7 @@ of COMMAND.
(evil-lisp-state-define-key "Y" copy-sexp t)
(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") 'sp-newline)
+(define-key evil-lisp-state-map (kbd "RET") 'evil-lisp-state-indent-next-line)
(defun evil-lisp-state-eval-sexp-end-of-line ()
"Evaluate the last sexp at the end of the current line."
@@ -228,4 +228,10 @@ of COMMAND.
(sp-insert-pair "(")
(indent-for-tab-command)))
+(defun evil-lisp-state-indent-next-line ()
+ "Indent line and go the next visual line."
+ (interactive)
+ (join-line 1)
+ (sp-newline))
+
(provide 'evil-lisp-state)