emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/evil-lisp-state 0fcd49259b 080/125: Reorganize the binding


From: ELPA Syncer
Subject: [nongnu] elpa/evil-lisp-state 0fcd49259b 080/125: Reorganize the bindings and align them with the philosophy behind evil-lisp-state
Date: Thu, 6 Jan 2022 04:58:43 -0500 (EST)

branch: elpa/evil-lisp-state
commit 0fcd49259bdd5827c05c17c4d17e5937fe9328fc
Author: sbenner <sylvain.benner@gmail.com>
Commit: sbenner <sylvain.benner@gmail.com>

    Reorganize the bindings and align them with the philosophy behind 
evil-lisp-state
    
    Version 4.0
---
 README.md          | 108 ++++++++++++++++++++++++++++++-----------------------
 evil-lisp-state.el |  69 +++++++++++++++++-----------------
 2 files changed, 95 insertions(+), 82 deletions(-)

diff --git a/README.md b/README.md
index ab938cddcd..eb70ae7f32 100644
--- a/README.md
+++ b/README.md
@@ -16,9 +16,11 @@ basis.**
         - [Manually](#manually)
     - [Configuration](#configuration)
         - [Backward prefix](#backward-prefix)
-    - [Simple to grasp navigation model](#simple-to-grasp-navigation-model)
-    - [Text selection](#text-selection)
-    - [Key bindings map](#key-bindings-map)
+    - [Philosophy](#philosophy)
+    - [Intuitive navigation model](#intuitive-navigation-model)
+    - [Key bindings maps](#key-bindings-maps)
+        - [Regular normal state bindings](#regular-normal-state-bindings)
+        - [Lisp specific bindings](#lisp-specific-bindings)
     - [Thanks](#thanks)
 
 <!-- markdown-toc end -->
@@ -71,6 +73,19 @@ whose value is determined by the custom variable
 For instance, `sp-forward-slurp-sexp` is performed with `s` and the backward
 version `sp-backward-slurp-sexp` with `<tab>s`.
 
+## Philosophy
+
+`evil-lisp-state` goal is to replace the `normal state` in lisp buffers so
+_you should not have the need_ to switch back and forth `normal state` and
+`lisp state`. In the case you do, please fill an issue.
+
+_Note that some mechanism will be provided in order to optional have
+`insert state` to go back to `lisp state` when pressing `ESC`. Stay tuned._
+
+To achieve this goal, this mode tries to keep the useful commands from the
+`normal state` and add new commands (often with `shift` modifier) for
+manipulating the data structure.
+
 ## Intuitive navigation model
 
 A lot of experimentation led to the following navigation model which should
@@ -89,78 +104,78 @@ hopefully be a lot more accessible than the other models.
 And that's it! All these commands always put the point _at the beginning_ of
 the sexp.
 
-## Text selection
+## Key bindings maps
 
-Text selection is done with [expand-region][expand-link] by pressing `v`.
-It is also possible to select the whole line with `V`.
+### Regular normal state bindings
 
-## Key bindings map
-
-In this table:
-- we assume that `evil-lisp-state-backward-prefix` is set
-to default `<tab>`
-- `*` means that the binding is the evil regular binding for this command
+Key Binding   | Function
+--------------|------------------------------------------------------------
+`a`           | evil-append
+`c`           | evil-change
+`d`           | evil-delete
+`h`           | next char
+`i`           | evil-insert-state
+`j`           | next visual line
+`k`           | previous visual line
+`l`           | next char
+`o`           | evil-insert-below
+`O`           | evil-insert-above
+`p`           | evil-past-after
+`P`           | evil-past-before
+`r`           | evil-replace
+`C-r`         | undo-tree-redo
+`u`           | undo-tree-undo
+`x`           | evil-delete-char
+`X`           | evil-delete-backward-char
+`y`           | evil-yank
+`ESC`         | evil-normal-state
+
+### Lisp specific bindings
+
+_In this table we assume that `evil-lisp-state-backward-prefix` is set to
+default `<tab>`_
 
 Key Binding   | Function
 --------------|------------------------------------------------------------
 `(`           | 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
-`a`           | *evil-append
 `A`           | sp-absorb-sexp
 `b`           | sp-forward-barf-sexp
 `<tab>b`      | sp-backward-barf-sexp
-`c`           | sp-convolute-sexp
-`C`           | sp-comment
-`dd`          | sp-kill-hybrid-sexp
-`dx`          | sp-kill-sexp
-`<tab>dx`     | sp-backward-kill-sexp
-`ds`          | sp-kill-symbol
-`<tab>ds`     | sp-backward-kill-symbol
-`dw`          | sp-kill-word
-`<tab>dw`     | sp-backward-kill-word
-`D`           | *evil-delete-line
+`C`           | sp-convolute-sexp
+`Dd`          | sp-kill-hybrid-sexp
+`Dx`          | sp-kill-sexp
+`<tab>Dx`     | sp-backward-kill-sexp
+`Ds`          | sp-kill-symbol
+`<tab>Ds`     | sp-backward-kill-symbol
+`Dw`          | sp-kill-word
+`<tab>Dw`     | sp-backward-kill-word
+`E$`          | evil-lisp-state-eval-sexp-end-of-line
+`Ee`          | eval-last-sexp
+`Ef`          | eval-defun
 `gs`          | go to source of symbol under point
-`h`           | *next char
+`gt`          | sp-transpose-sexp
+`gT`          | sp-transpose-hybrid-sexp
 `H`           | previous sexp at the same level
-`i`           | *evil-insert-state
-`j`           | *next visual line
 `J`           | next sexp one level down
-`k`           | *previous visual line
 `K`           | previous sexp one level up
-`l`           | *next char
 `L`           | next sexp of the same level
-`m`           | sp-join-sexp (think about `merge-sexp`)
-`o`           | *evil-insert-below
-`O`           | *evil-insert-above
-`p`           | *evil-past-after
-`P`           | *evil-past-before
-`r`           | *evil-replace
+`M`           | sp-join-sexp (think about `merge-sexp`)
 `R`           | sp-raise-sexp
-`C-r`         | *undo-tree-redo
 `s`           | sp-forward-slurp-sexp
 `<tab>s`      | sp-backward-slurp-sexp
 `S`           | sp-splice-sexp-killing-forward
 `<tab>S`      | sp-splice-sexp-killing-backward
-`t`           | sp-transpose-sexp
-`T`           | sp-transpose-hybrid-sexp
-`u`           | *undo-tree-undo
-`<tab>U`      | sp-backward-unwrap-sexp
 `w`           | wrap sexp
 `W`           | unwrap sexp
-`x$`          | evil-lisp-state-eval-sexp-end-of-line
-`xf`          | eval-defun
-`xl`          | eval-last-sexp
-`xx`          | eval-sexp
-`y`           | *evil-yank
+`<tab>W`      | sp-backward-unwrap-sexp
 `Y`           | sp-copy-sexp
 `<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`)
-`ESC`         | *evil-normal-state
 
 ## Thanks
 
@@ -171,4 +186,3 @@ have been a lot harder to implement.
 [evil-link]: https://gitorious.org/evil/pages/Home
 [smartparens-link]: https://github.com/Fuco1/smartparens/wiki
 [melpa-link]: http://melpa.milkbox.net
-[expand-link]: https://github.com/magnars/expand-region.el
diff --git a/evil-lisp-state.el b/evil-lisp-state.el
index 2875491a61..2d410576fb 100644
--- a/evil-lisp-state.el
+++ b/evil-lisp-state.el
@@ -5,7 +5,7 @@
 ;;;; Author: Sylvain Benner <sylvain.benner@gmail.com>
 ;; Keywords: convenience editing evil smartparens lisp mnemonic
 ;; Created: 9 Oct 2014
-;; Version: 3.4
+;; Version: 4.0
 ;; Package-Requires: ((evil "1.0.9") (smartparens "1.6.1"))
 ;; URL: https://github.com/syl20bnr/evil-lisp-state
 
@@ -92,9 +92,7 @@ of COMMAND.
                 (bkey ,(concat evil-lisp-state-backward-prefix key)))
            (define-key evil-lisp-state-map (kbd bkey) bcmdsym)))))
 
-;; key bindings
-(define-key evil-lisp-state-map "("   'evil-lisp-state-insert-sexp-before)
-(define-key evil-lisp-state-map ")"   'evil-lisp-state-insert-sexp-after)
+;; regular normal state key bindings
 (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)
@@ -104,57 +102,58 @@ of COMMAND.
 (define-key evil-lisp-state-map "7"   'digit-argument)
 (define-key evil-lisp-state-map "8"   'digit-argument)
 (define-key evil-lisp-state-map "9"   'digit-argument)
-(define-key evil-lisp-state-map "$"   'sp-end-of-sexp)
-(define-key evil-lisp-state-map "0"   'sp-beginning-of-sexp)
 (define-key evil-lisp-state-map "a"   'evil-append)
-(define-key evil-lisp-state-map "A"   'sp-absorb-sexp)
-(evil-lisp-state-define-key     "b"    forward-barf-sexp t)
-(define-key evil-lisp-state-map "c"   'sp-convolute-sexp)
-(define-key evil-lisp-state-map "C"   'sp-comment)
-(define-key evil-lisp-state-map "dd"  'sp-kill-hybrid-sexp)
-(evil-lisp-state-define-key     "dx"   kill-sexp t)
-(evil-lisp-state-define-key     "ds"   kill-symbol t)
-(evil-lisp-state-define-key     "dw"   kill-word t)
-(define-key evil-lisp-state-map "D"   'evil-delete-line)
-(define-key evil-lisp-state-map "gs"  
'elisp-slime-nav-find-elisp-thing-at-point)
+(define-key evil-lisp-state-map "c"   'evil-change)
+(define-key evil-lisp-state-map "d"   'evil-delete)
 (define-key evil-lisp-state-map "h"   'evil-backward-char)
-(define-key evil-lisp-state-map (kbd "C-h") 'sp-backward-sexp)
-(define-key evil-lisp-state-map "H"   'evil-lisp-state-previous-sexp)
 (define-key evil-lisp-state-map "j"   'evil-next-visual-line)
-(define-key evil-lisp-state-map "J"   'evil-lisp-state-next-sexp-down)
 (define-key evil-lisp-state-map "k"   'evil-previous-visual-line)
-(define-key evil-lisp-state-map "K"   'sp-backward-up-sexp)
 (define-key evil-lisp-state-map "l"   'evil-forward-char)
-(define-key evil-lisp-state-map (kbd "C-l") 'evil-lisp-state-forward-symbol)
-(define-key evil-lisp-state-map "L"   'sp-next-sexp)
-(define-key evil-lisp-state-map "m"   'sp-join-sexp)
 (define-key evil-lisp-state-map "o"   'evil-open-below)
 (define-key evil-lisp-state-map "O"   'evil-open-above)
 (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"   'evil-replace)
-(define-key evil-lisp-state-map "R"   'sp-raise-sexp)
 (define-key evil-lisp-state-map (kbd "C-r") 'undo-tree-redo)
+(define-key evil-lisp-state-map "u"   'undo-tree-undo)
+(define-key evil-lisp-state-map "x"   'evil-delete-char)
+(define-key evil-lisp-state-map "X"   'evil-delete-backward-char)
+(define-key evil-lisp-state-map "y"   'evil-yank)
+(define-key evil-lisp-state-map "i"         'evil-insert-state)
+(define-key evil-lisp-state-map [escape]    'evil-normal-state)
+;; lisp specific key bindings
+(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 "$"   'sp-end-of-sexp)
+(define-key evil-lisp-state-map "0"   'sp-beginning-of-sexp)
+(define-key evil-lisp-state-map "A"   'sp-absorb-sexp)
+(evil-lisp-state-define-key     "b"    forward-barf-sexp t)
+(define-key evil-lisp-state-map "C"   'sp-convolute-sexp)
+(define-key evil-lisp-state-map "Dd"  'sp-kill-hybrid-sexp)
+(evil-lisp-state-define-key     "Dx"   kill-sexp t)
+(evil-lisp-state-define-key     "Ds"   kill-symbol t)
+(evil-lisp-state-define-key     "Dw"   kill-word t)
+(define-key evil-lisp-state-map "E$"  'evil-lisp-state-eval-sexp-end-of-line)
+(define-key evil-lisp-state-map "Ee"  'eval-last-sexp)
+(define-key evil-lisp-state-map "Ef"  'eval-defun)
+(define-key evil-lisp-state-map "gs"  
'elisp-slime-nav-find-elisp-thing-at-point)
+(define-key evil-lisp-state-map "gt"  'sp-transpose-sexp)
+(define-key evil-lisp-state-map "gT"  'sp-transpose-hybrid-sexp)
+(define-key evil-lisp-state-map "H"   'evil-lisp-state-previous-sexp)
+(define-key evil-lisp-state-map "J"   'evil-lisp-state-next-sexp-down)
+(define-key evil-lisp-state-map "K"   'sp-backward-up-sexp)
+(define-key evil-lisp-state-map "L"   'sp-next-sexp)
+(define-key evil-lisp-state-map "M"   'sp-join-sexp)
+(define-key evil-lisp-state-map "R"   'sp-raise-sexp)
 (evil-lisp-state-define-key     "s"    forward-slurp-sexp t)
 (evil-lisp-state-define-key     "S"    splice-sexp-killing-forward t)
-(define-key evil-lisp-state-map "t"   'sp-transpose-sexp)
-(define-key evil-lisp-state-map "T"   'sp-transpose-hybrid-sexp)
-(define-key evil-lisp-state-map "u"   'undo-tree-undo)
 (define-key evil-lisp-state-map "w"   '(lambda (&optional arg) (interactive 
"P")
                                          (sp-wrap-with-pair "(")))
 (evil-lisp-state-define-key     "W"    unwrap-sexp t)
-(define-key evil-lisp-state-map "x$"  'evil-lisp-state-eval-sexp-end-of-line)
-(define-key evil-lisp-state-map "xf"  'eval-defun)
-(define-key evil-lisp-state-map "xl"  'eval-last-sexp)
-(define-key evil-lisp-state-map "xx"  'eval-sexp)
-(define-key evil-lisp-state-map "y"   'evil-yank)
 (evil-lisp-state-define-key     "Y"    copy-sexp t)
-(define-key evil-lisp-state-map (kbd "<S-tab>") 'evil-lisp-state-previous-sexp)
 (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 "i"         'evil-insert-state)
-(define-key evil-lisp-state-map [escape]    'evil-normal-state)
 
 (defun evil-lisp-state-eval-sexp-end-of-line ()
   "Evaluate the last sexp at the end of the current line."



reply via email to

[Prev in Thread] Current Thread [Next in Thread]