summaryrefslogtreecommitdiff
path: root/modes/vterm
diff options
context:
space:
mode:
authorJakub Kadlcik <frostyx@email.cz>2023-04-18 18:09:37 +0200
committerJames <1227856+jojojames@users.noreply.github.com>2023-05-01 21:09:38 -0700
commit0df5c4815d7be01ab52e9f957c56e6318c871217 (patch)
treeda769bf308561c4450e7c13005855ef763d6fdf9 /modes/vterm
parent48810f908f8074df835ef7f82256bc0a5a7d1652 (diff)
vterm: allow moving the cursor backwards when exiting insert state
See #719
Diffstat (limited to 'modes/vterm')
-rw-r--r--modes/vterm/evil-collection-vterm.el8
1 files changed, 7 insertions, 1 deletions
diff --git a/modes/vterm/evil-collection-vterm.el b/modes/vterm/evil-collection-vterm.el
index a77ee21..bafef53 100644
--- a/modes/vterm/evil-collection-vterm.el
+++ b/modes/vterm/evil-collection-vterm.el
@@ -40,11 +40,17 @@
(defvar vterm--process)
+(defcustom evil-collection-vterm-move-cursor-back nil
+ "Whether the cursor is moved backwards when exiting insert state."
+ :type 'boolean
+ :group 'vterm)
+
(defun evil-collection-vterm-escape-stay ()
"Go back to normal state but don't move cursor backwards.
Moving cursor backwards is the default vim behavior but
it is not appropriate in some cases like terminals."
- (setq-local evil-move-cursor-back nil))
+ (setq-local evil-move-cursor-back
+ evil-collection-vterm-move-cursor-back))
(defvar-local evil-collection-vterm-send-escape-to-vterm-p nil
"Track whether or not we send ESC to `vterm' or `emacs'.")