How to change binding in zsh? command key vs control key

keybindingsterminalzsh

I moved to Mac OS and I'm facing the control vs command key problem.

I already changed the settings for my external keyboard, so that my control key is mapped to command key and viceversa. This fixes my habits of ctrl-x,c,v,z and ctrl-t,ctrl-w for the browser and most applications.

However, when I work with Terminal and zsh, now ctrl-w, ctrl-u, ctrl-a etc… does not do what I expect, because I'm of course sending command-w etc.

How do I fix this once and for all so that I don't need to change my habits?

Best Answer

  1. Install the awesome, free Karabiner-Elements app.
  2. Install the "Keyboard shortcuts for Terminal apps" mod.

Then, instead of using ^W, ^U, ^A, etc., you can just use the modifier keys (//) plus the arrow/delete keys (/////), just as you do in the rest of macOS.

Don't like those exact mappings? Just git clone https://github.com/pqrs-org/KE-complex_modifications.git and write your own mod. ?

Related Question