From 084defb16584b12515b15b2a339c4c46d2319b08 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Sun, 13 Dec 2020 19:38:33 -0500 Subject: [PATCH] Reset sp-pair-overlay-keymap for evil users Smartparens creates a conditional keybind on C-g when its overlays are present (whether or not they're visible). This causes confusion when evil users are forced to press C-g twice to exit insert mode. --- core/core-editor.el | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/core/core-editor.el b/core/core-editor.el index 357169599..a30183c80 100644 --- a/core/core-editor.el +++ b/core/core-editor.el @@ -487,7 +487,12 @@ files, so we replace calls to `pp' with the much faster `prin1'." ;; correct this vile injustice. (setq sp-show-pair-from-inside t) ;; ...and stay highlighted until we've truly escaped the pair! - (setq sp-cancel-autoskip-on-backward-movement nil)) + (setq sp-cancel-autoskip-on-backward-movement nil) + ;; Smartparens conditional binds a key to C-g when sp overlays are active + ;; (even if they're invisible). This disruptively changes the behavior of + ;; C-g in insert mode, requiring two presses of the key to exit insert mode. + ;; I don't see the point of this keybind, so... + (setq sp-pair-overlay-keymap (make-sparse-keymap))) ;; The default is 100, because smartparen's scans are relatively expensive ;; (especially with large pair lists for some modes), we reduce it, as a