[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/evil-exchange 524a82a5ac 25/46: document improvement
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/evil-exchange 524a82a5ac 25/46: document improvement |
Date: |
Thu, 6 Jan 2022 03:59:52 -0500 (EST) |
branch: elpa/evil-exchange
commit 524a82a5aca7032ac74a5cb5b3dda68e8e993aee
Author: Dewdrops <v_v_4474@126.com>
Commit: Dewdrops <v_v_4474@126.com>
document improvement
---
README.md | 14 ++++++++++++++
evil-exchange.el | 8 ++++----
2 files changed, 18 insertions(+), 4 deletions(-)
diff --git a/README.md b/README.md
index 4a702e8830..34f69fb43f 100644
--- a/README.md
+++ b/README.md
@@ -40,3 +40,17 @@ Customization
You can change the default bindings by customizing `evil-exchange-key` and/or
`evil-exchange-cancel-key` BEFORE `evil-exchange-install` is called.
+[Experienmental] Vim-compatible key bindings
+-------
+
+Due to the way how evil (and emacs) implements key bindings, `evil-exchange`
can't be bound to `cx` (which is the default bindings of the original
+vim plugin) by customizing `evil-exchange-key` option. If you prefer the key
bindings suggested by vim-exchange, you can try the settings below:
+
+```lisp
+(require 'evil-exchange)
+(evil-exchange-cx-install)
+```
+
+The `evil-exchange-cx-install` function tries to mimic the original vim
plugin's behaviour, i.e. `cx` in normal state bound to `evil-exchange`,
+`cxc` in normal state bound to `evil-exchange-cancel`, and `X` in visual state
bound to `evil-exchange`.
+
diff --git a/evil-exchange.el b/evil-exchange.el
index 7fc8154bee..9bc7a6e146 100644
--- a/evil-exchange.el
+++ b/evil-exchange.el
@@ -127,10 +127,10 @@
;; 2. call extract-fn with curr-beg and curr-end to extract curr-text.
;; 3. go to orig-beg and then call insert-fn with curr-text.
;; 4. go to curr-beg and then call insert-fn with orig-text.
- ;; After step 2, curr-beg and curr-end (the same as orig-beg and orig-end)
- ;; will point to the same position. So if orig-beg is at the same position of
- ;; curr-end initially, orig-beg and curr-beg will point to the same position
- ;; before step 3. Because curr-beg is a marker moved after insertion, the
+ ;; After step 2, the two markers of the same beg/end pair (curr or orig)
+ ;; will point to the same position. So if orig-beg points to the same
position
+ ;; of curr-end initially, orig-beg and curr-beg will point to the same
position
+ ;; before step 3. Because curr-beg is a marker which moves after insertion,
the
;; insertion in step 3 will push it to the end of the newly inserted text,
;; thus resulting incorrect behaviour.
;; To fix this edge case, we swap two extracted texts before step 3 to
- [nongnu] branch elpa/evil-exchange created (now ac50f21b29), ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-exchange 658de11e4c 08/46: Merge pull request #1 from bitdeli-chef/master, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-exchange 41206c0e47 06/46: improve doc, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-exchange fe611c6970 15/46: update copyright and bump version, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-exchange e7a403074e 04/46: Make comments conform to emacs' convention, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-exchange 0539868f46 17/46: Drop use of `transpose-regions`, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-exchange 524a82a5ac 25/46: document improvement,
ELPA Syncer <=
- [nongnu] elpa/evil-exchange 5537594572 26/46: update requirement and copyright, bump version, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-exchange 29bd39d942 31/46: bump version, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-exchange cbb670e1ca 28/46: fix wrong boundary, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-exchange 8210cdb79b 39/46: Add travis-ci badge, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-exchange 6786f0cfaa 40/46: fix obsolete, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-exchange 35dd0f0662 43/46: Merge pull request #13 from nnoodle/patch-1, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-exchange 3030e21ee1 45/46: Merge pull request #15 from tmurph/master, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-exchange 6411ce3e5f 03/46: require fix, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-exchange 31dad20db1 05/46: header fix, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-exchange 271c4b3b0a 09/46: Add require for cl-lib, ELPA Syncer, 2022/01/06