'How do I use Fish's Alt bindings using Kitty on macOS

I acquired a macOS machine for the first time, and I can't figure out how to use commands such as alt+E to open the current command in $EDITOR.

I don't want to remap the key to alt system-wide, but I can't figure out how to the remap in either Kitty or Fish.

Why is the fish binding not working in mac os? is a relevant question but the answer there only applies to iTerm2.



Solution 1:[1]

Kitty allows treating ? as alt with macos_option_as_alt. So I've put

macos_option_as_alt yes

into kitty.conf and started using ? as my alt replacement on macOS.

It seems that it's discouraged on macOS to reuse ? as a modifier.

Solution 2:[2]

By pressing ?+e, I found out that the shell gets "[101;9u", so I've decided to create a custom binding:

bind "[101;9u" edit_command_buffer

This way I get the alt+e equivalent on macOS.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 gregorias
Solution 2 gregorias