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

Rewriting key bindings #3847

Open
DamienCassou opened this issue Oct 24, 2019 · 3 comments
Labels

Comments

@DamienCassou
Copy link
Contributor

@DamienCassou DamienCassou commented Oct 24, 2019

I'm submitting a…

[x] Feature Request

I would like to use Emacs bindings in every app I use. For that, I can have something like this in my i3 configuration file:

# Bind Control+b so it moves the cursor one character to the left:
bindsym --release Control+b exec --no-startup-id xdotool key --clearmodifiers Left

This "works" but has problems that prevent me from actually using it:

  • using xdotool means executing a command for each key press which is noticeably slow (especially when I have to press it a lot of times quickly)
  • I can't let Control+b pressed for some time to go back many characters
  • the binding is active for every window, even for Emacs which makes no sense and may even be problematic (if Left has a different meaning than Control+b there)
  • you can't have more complex keybindings such as Control+x h

I'm dreaming about something like that in my configuration file:

# Bind Control+b so it moves the cursor one character to the left:
rebindsym [class!="Emacs"] Control+b to Left
# Bind Control+x h so it selects all text:
rebindsym [class!="Emacs"] Control+x h to Control+a

Note the rebindsym new keyword and the != new operator (to exclude Emacs).

@i3bot i3bot added the enhancement label Oct 24, 2019
@Airblader

This comment has been minimized.

Copy link
Member

@Airblader Airblader commented Oct 24, 2019

I think I would rather send this kind of complexity to dedicated software for this purpose.

@DamienCassou

This comment has been minimized.

Copy link
Contributor Author

@DamienCassou DamienCassou commented Oct 28, 2019

@Airblader

This comment has been minimized.

Copy link
Member

@Airblader Airblader commented Oct 28, 2019

Window managers are not special in this regard, any X client can capture key bindings the same. The difference is just who does it "first".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.