[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/evil-lisp-state 45bbdfce7f 072/125: Insert sibling before/
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/evil-lisp-state 45bbdfce7f 072/125: Insert sibling before/after bindings on `(` and `)` respectively |
Date: |
Thu, 6 Jan 2022 04:58:42 -0500 (EST) |
branch: elpa/evil-lisp-state
commit 45bbdfce7ffaea08ac9196c02133a302d911e2b3
Author: syl20bnr <sylvain.benner@gmail.com>
Commit: syl20bnr <sylvain.benner@gmail.com>
Insert sibling before/after bindings on `(` and `)` respectively
---
README.md | 3 ++-
evil-lisp-state.el | 31 +++++++++++++++++--------------
2 files changed, 19 insertions(+), 15 deletions(-)
diff --git a/README.md b/README.md
index eebc032e01..d61f1c11b0 100644
--- a/README.md
+++ b/README.md
@@ -101,7 +101,8 @@ to default `<tab>`):
Key Binding | Function
--------------|------------------------------------------------------------
-`(` | switch to `insert state` and insert "("
+`(` | insert sibling before sexp and switch to `insert state`
+`)` | insert sibling after sexp and switch to `insert state`
`%` | evil-jump-item (use it to go to the end of sexp)
`$` | sp-end-of-sexp
`0` | sp-beginning-of-sexp
diff --git a/evil-lisp-state.el b/evil-lisp-state.el
index 1a76af7595..3c2a8af5d7 100644
--- a/evil-lisp-state.el
+++ b/evil-lisp-state.el
@@ -93,7 +93,8 @@ of COMMAND.
(define-key evil-lisp-state-map (kbd bkey) bcmdsym)))))
;; key bindings
-(define-key evil-lisp-state-map "(" 'evil-lisp-state-insert-left-paren)
+(define-key evil-lisp-state-map "(" 'evil-lisp-state-insert-sexp-before)
+(define-key evil-lisp-state-map ")" 'evil-lisp-state-insert-sexp-after)
(define-key evil-lisp-state-map "1" 'digit-argument)
(define-key evil-lisp-state-map "2" 'digit-argument)
(define-key evil-lisp-state-map "3" 'digit-argument)
@@ -189,22 +190,24 @@ of COMMAND.
(defun evil-lisp-state-insert-sexp-after ()
"Insert sexp after the current one."
(interactive)
- (if (char-equal (char-after) ?\() (evil-lisp-state-forward-symbol))
- (sp-up-sexp)
- (evil-insert-state)
- (sp-newline)
- (sp-insert-pair "("))
+ (let ((sp-navigate-consider-symbols nil))
+ (if (char-equal (char-after) ?\() (evil-lisp-state-forward-symbol))
+ (sp-up-sexp)
+ (evil-insert-state)
+ (sp-newline)
+ (sp-insert-pair "(")))
(defun evil-lisp-state-insert-sexp-before ()
"Insert sexp before the current one."
(interactive)
- (if (char-equal (char-after) ?\() (evil-lisp-state-forward-symbol))
- (sp-backward-sexp)
- (evil-insert-state)
- (sp-newline)
- (evil-previous-visual-line)
- (evil-end-of-line)
- (sp-insert-pair "(")
- (indent-for-tab-command))
+ (let ((sp-navigate-consider-symbols nil))
+ (if (char-equal (char-after) ?\() (evil-lisp-state-forward-symbol))
+ (sp-backward-sexp)
+ (evil-insert-state)
+ (sp-newline)
+ (evil-previous-visual-line)
+ (evil-end-of-line)
+ (sp-insert-pair "(")
+ (indent-for-tab-command)))
(provide 'evil-lisp-state)
- [nongnu] elpa/evil-lisp-state 159e849c2c 102/125: Tweak key bindings, (continued)
- [nongnu] elpa/evil-lisp-state 159e849c2c 102/125: Tweak key bindings, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-lisp-state 63e3183d14 101/125: Disabel auto-switch to lisp state for some commands, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-lisp-state 77bc863b7c 113/125: Fix default value for evil-lisp-state-enter-lisp-state-on-command, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-lisp-state 9d07f9efad 116/125: Reapply fix of confusion message when toggling state, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-lisp-state 12f974b74d 124/125: Allow navigation for braces and brackets with j/k., ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-lisp-state b4c54ee3a0 122/125: Bump version to 8.1, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-lisp-state 3c65fecd99 125/125: Bump version to 8.2, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-lisp-state 0e7f902c74 029/125: Use directions for delete functions, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-lisp-state 5df70d1088 035/125: Bind sp-foward-symbol to `w`, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-lisp-state 36d945c5db 071/125: Add autoload cookie to required custom variable, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-lisp-state 45bbdfce7f 072/125: Insert sibling before/after bindings on `(` and `)` respectively,
ELPA Syncer <=
- [nongnu] elpa/evil-lisp-state 3953f28dd2 078/125: Keep regular `r` binding for evil-replace, raise an sexp with `R`, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-lisp-state 0fcd49259b 080/125: Reorganize the bindings and align them with the philosophy behind evil-lisp-state, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-lisp-state d614275d93 094/125: Fix byte-compilation for defcustom variable, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-lisp-state 2eb0011287 105/125: Update README to version 7, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-lisp-state dbb3870e2b 104/125: Version 7, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-lisp-state 5aea6675bb 114/125: evil-lisp-state-leader is now a function, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-lisp-state e5792ec68a 109/125: Add key bindings for navigation, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-lisp-state 16c01d79b2 123/125: Define evil-lisp-state-major-mode-map, ELPA Syncer, 2022/01/06