evil-surround
evil-surround copied to clipboard
use evil's facilities to correct key translations
I have the following keybindings in init.el (define-key key-translation-map (kbd "[") (kbd "(")) (define-key key-translation-map (kbd "]") (kbd "[")) (define-key key-translation-map (kbd "(") (kbd "{"))
However evil/surround will ignore them and use the regular keys, i i would like to wrap a world with () it becomes [] with evil/surround. Is there a possible fix for this?
Also after watching this https://www.youtube.com/watch?v=5HF4jSyPpvs not much of what he shows work with this plugin, am i doing it wrong for example the dst cat does not work?
I also have an issue trying to si{
when using this translation-key-map (define-key key-translation-map (kbd "M-(") (kbd "{"))
(to make shift-alt-8
work like you expect on a norwegian keyboard)
I'm still looking for a solution to this. Here's a gif showing the issue at hand:
This is with the following key-translation-map
s in play
(define-key key-translation-map (kbd "M-(") (kbd "{"))
(define-key key-translation-map (kbd "M-)") (kbd "}"))
Running e.g. si(
when a key-tanslation-map is in place for (
results in Wrong type argument: characterp, 134217769
.
The si{
case is possibly another issue, as I have no translation for {
(which is shift meta 8
on a norwegian os x keyboard)
this issue may actually be resolved with my (already merged) pull request https://github.com/timcharper/evil-surround/pull/81
@favetelinguis @torgeir any chance you can try it out?
i am using evil-swap-keys and can confirm that things like ds(
work fine for me without pressing the shift key at all, since 9
and (
are swapped by that package.
this issue may actually be resolved with my (already merged) pull request #81
Indeed, works like a charm! All my tests from above seems to be working perfectly.
awesome.
@timcharper this issue can be closed. (btw feel free to make me a collaborator so that i can close and tag issues.)
Oh, thank you!
I believe this has resurfaced again? Seems the changes of #81 is no longer in master
.
@torgeir you are right. :(
https://github.com/emacs-evil/evil-surround/issues/84#issuecomment-273868085
Ah, missed that.
It was unfortunate that #81 contained a regression that was actually a big deal because it broke the .
operator for evil-surround. The .
operator is critical for this plugin.
But maybe we can ressurect #81 with the hack contained in #115. This would bring the benefits of #81, but without also bringing in #24 as a regression.
The regression caused by #81 is actually caused by a bug in evil (see https://github.com/emacs-evil/evil/pull/865 for some context), and #115 is actually just a poor man's #81. #81 should be un-reverted once the root bug in evil is solved. But I haven't had time to look into it more and figure out a solution that doesn't break other things, so I'm not sure when that will be.
Any updates on this one?
@torgeir https://github.com/emacs-evil/evil/pull/865 is stalled.
I haven't made progress on the evil bug. Too busy in school and working on rash. Sorry about that.
Reopened because we are waiting for https://github.com/emacs-evil/evil/pull/865 to be merged into master in evil. See pull https://github.com/emacs-evil/evil-surround/pull/115 by @willghatch.