Closed rieje closed 7 years ago
try to not activate the evil-surround minor mode. and see if it works.
I'm not sure why there isn't a function for M-x
to execute but I pasted (turn-off-evil-surround-mode)
into the buffer, evaluated the sexp, and then it works.
Also, if I changed the binding from s
to something that isn't used by evil-surround like o
then it also works.
there you go.
Sorry if noob question, but what makes evil-surround's s
prioritize over my attempt to rebind it to something else? And how can I rebind s
to something else for evil-surround?
no problem. I am a huge noob in elisp.
I think the hack comprises this snippet, combined with this snippet.
I'd guess that you could change the minor mode binding in the second snippet to another key, say, r
. So evil-surround would be called with yr
. then you could free up s
to your liking.
I'd go with that for my first try.
Thanks. I have the following now and it works:
(evil-define-key 'operator evil-surround-mode-map "r" 'evil-surround-edit)
(evil-define-key 'operator evil-surround-mode-map "s" nil)
(evil-define-key 'operator global-map (kbd "s") #'avy-goto-char-timer)
If anyone knows a more concise or simpler way to achieve the same thing, I'd love to know.
I want to override the
s
keybinding which is bound toevil-surround-edit
in evil's operator state to rebind it toevil-avy-goto-char
. I have the following but it still doesn't work:According to an evil maintainer,
evil-surround
does some hackery to get the bindings to work. How can I override thes
key?