0
votes

There are several vim clone packages for Emacs (Evil, Viper..). These packages have a special built in functionality where they remap the Escape key for tty users. I'm not sure how this is done (With a timeout?).

I'd like this functionality as well however I don't want to use the entire Evil / Viper package, I only want the Escape key functionality. This is because I use God Mode, basically Vim's normal / Insert mode with emacs keybindings instead. It doesn't however have a solution for the TTY Escape key like Evil / Viper do. My Elisp isn't really good enough to implement this myself.

So if there is a stand alone package for the escape key issue I'd love to hear about it.

1
What exactly do you want the Esc key to do? It looks like in God Mode it toggles between modes. Is the issue that it works in graphical Emacs but not in the terminal version?echristopherson
Yes, in the terminal version Esc is the same as Meta, so if you remap esc Meta will stop working. I don't know how Evil / Viper fixes this issue for the terminal.Attic

1 Answers

0
votes

This doesn't /really/ answer my question but I've found something nice that solves my problem.

Xcape is a tool that you can use change the behavior of a key. For example if you run this command:

xcape -e 'Control_L=Control_L|G'

When pressing Left Control and releasing right away, it will act as Control-G. If you hold down Control it will simply act as Control normally does.

Now if I remap C-g to active God-mode I get the expected behavior in the terminal as well. And you can change the keys to however you want.

As I said this doesn't really answer my question but it does solve the problem. So I'll just leave this answer for other people to find.