reddit / emacs

Need help with corfu keybinding.

lifer0se ยท 2022-07-17 00:33
Hey all! I've been using corfu and evil mode for a while now and I have one small thing that I cannot seem to get working. I would like to map escape to do the same thing as the return key, i.e: keep the autocompleted selection and close the corfu window. I've tried mapping escape to corfu-insert many different ways but none seem to work - escape always keeps resetting the autocompletion. I even tried editing the default mappings in corfu.el, changing corfu-reset to corfu-insert with no luck.. What am I missing? The idea seems fairly simple yet for the life of me I can't get it working. Please help! Also, it'd be awesome if I could run the evil-normal-state command after corfu-insert as well, so I can press escape, keep the autocompletion and go back to normal mode. That would be the ideal senario anyway. Thanks in advance :)