Configuration load order

Hello, I am having some issues binding keys with cua-mode. I am aware it has a cua-global-keymap, and manually evaluating the following works fine:

(map! :after evil
      :map cua-global-keymap
      "C-<return>" nil)

But when I restart emacs (exit/start), I still see the binding, it doesn’t get removed, or it gets removed but gets re-added at some point. I do not know.

I also tried after! cua-base and with-eval-after-load cua-base. They also do not remove the keybind during the restart.

To workaround this and as a proof of concept, I added a hook to 'doom-init-ui-hook, which works fine during restarts, and effectively keeps the key bind nil.

(add-hook 'doom-init-ui-hook (lambda ()
                               (map! :map cua-global-keymap
                                     "C-<return>" nil)))

Does anybody know why this is happening?

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.