0

I use evil-embrace together with evil-surround and remapped the evil-surround keys with:

(setq-default evil-surround-pairs-alist
              '((?b . ("(" . ")"))
                (?c . ("{" . "}"))
                (?B . ("[" . "]"))
                (?d . ("\"" . "\""))
                (?s . ("'" . "'"))
                (?F . ("`" . "`"))
                (?a . ("<" . ">"))))
(setq-default evil-embrace-evil-surround-keys '(?b ?c ?B ?d ?s ?F ?a))

How can I remove some default mappings from evil-embrace, so that they don't show up twice in the which-key help buffer? Meaning I don't need the " -> ".." binding in evil embrace since I use evil-surround with d for that.

enter image description here

I assume they are defined in this function in embrace.el, but I still don't know elisp well enough to being able to change that from my init file:

(defun embrace--setup-defaults ()
  (dolist (pair '(
                  (?\( . ("(" . ")"))
                  (?\) . ("( " . " )"))
                  (?\{ . ("{" . "}"))
                  (?\} . ("{ " . " }"))
                  (?\[ . ("[" . "]"))
                  (?\] . ("[ " . " ]"))
                  (?< . ("<" . ">"))
                  (?> . ("< " . " >"))
                  (?\" . ("\"" . "\""))
                  (?\' . ("\'" . "\'"))
                  (?` . ("`" . "`"))
                  ))
    (embrace-add-pair (car pair) (cadr pair) (cddr pair)))
  (embrace-add-pair-regexp ?t "<[^>]*?>" "</[^>]*?>" 'embrace-with-tag
                           (embrace-build-help "<tag attr>" "</tag>"))
  (embrace-add-pair-regexp ?f "\\(\\w\\|\\s_\\)+?(" ")" 'embrace-with-function
                           (embrace-build-help "function(" ")")))

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.