Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use evil's facilities to correct key translations #36

Open
favetelinguis opened this issue Sep 10, 2014 · 16 comments
Open

use evil's facilities to correct key translations #36

favetelinguis opened this issue Sep 10, 2014 · 16 comments

Comments

@favetelinguis
Copy link

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?

@torgeir
Copy link

torgeir commented Dec 6, 2015

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)

@torgeir
Copy link

torgeir commented May 8, 2016

I'm still looking for a solution to this. Here's a gif showing the issue at hand:

evil-surround-issue mov

This is with the following key-translation-maps 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)

@wbolster
Copy link
Contributor

wbolster commented Nov 4, 2016

this issue may actually be resolved with my (already merged) pull request #81

@favetelinguis @torgeir any chance you can try it out?

@wbolster
Copy link
Contributor

wbolster commented Nov 4, 2016

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.

@torgeir
Copy link

torgeir commented Nov 5, 2016

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.

@wbolster
Copy link
Contributor

wbolster commented Nov 5, 2016

awesome.

@timcharper this issue can be closed. (btw feel free to make me a collaborator so that i can close and tag issues.)

@timcharper
Copy link
Collaborator

Oh, thank you!

@torgeir
Copy link

torgeir commented Jul 18, 2017

I believe this has resurfaced again? Seems the changes of #81 is no longer in master.

@wbolster
Copy link
Contributor

@torgeir you are right. :(

#84 (comment)

@torgeir
Copy link

torgeir commented Jul 18, 2017

Ah, missed that.

@ninrod
Copy link
Member

ninrod commented Jul 18, 2017

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.

@willghatch
Copy link

The regression caused by #81 is actually caused by a bug in evil (see emacs-evil/evil#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.

@torgeir
Copy link

torgeir commented Nov 4, 2017

Any updates on this one?

@ninrod
Copy link
Member

ninrod commented Nov 4, 2017

@torgeir emacs-evil/evil#865 is stalled.

@willghatch
Copy link

I haven't made progress on the evil bug. Too busy in school and working on rash. Sorry about that.

@ninrod ninrod reopened this Dec 10, 2017
@ninrod ninrod changed the title Wrong key mappings fix evil's key translations Dec 10, 2017
@ninrod ninrod changed the title fix evil's key translations use evil's facilities to correct key translations Dec 10, 2017
@ninrod
Copy link
Member

ninrod commented Dec 10, 2017

Reopened because we are waiting for emacs-evil/evil#865 to be merged into master in evil. See pull #115 by @willghatch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants