Attempt to overwrite which-key labels

I have been trying to remap all Org major mode key bindings. Some of the new bindings overlap with the original ones, and I found out that which-key labels persist even though the bindings are modified adequately.

At first, I felt very smart with my recently acquired new Emacs skills navigating the source files thanks to the help commands to find out which file in the loading sequence was responsible.

After countless attempts at combining some unbinding and many different :after clauses, I found issue 814 where hlissner explains in details why this happens. Since which-key labels are set globally, I managed to make it work using the following code:

(map! :after evil-org
      :leader
      "n" nil)
(map! :map global-map
      :leader
      :prefix ("n" . "notes")
      :desc "Show graph" "g" #'org-roam-graph
      :desc "Org Manual" "h" #'org-info-find-node
      :desc "Capture" "n" #'org-roam-capture
      :desc "Sync database" "s" #'org-roam-db-sync
      )

So I simply would like to know if it is ok to use global-map this way if there is aa better way to do it. Thanks for your time.

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