I'm not sure if this is package-specific (example here is
olivetti-mode), but when I try to "remap" with statement:
(define-key olivetti-mode-map (kbd "<f7> ]") 'olivetti-shrink) (for some reason you have also wrap this in
eval-after-load, but omitted here)
The old keybinding for the function
C-c ]) stays in place, so that I now get two keybindings for the same function. I only want the new key-binding. As a general rule, do you have to map to
nil whenever you want to change the key binding:
(define-key some-mode-map (kbd "old-key") nil) (define-key some-mode-map (kbd "new-key") function)
I'm wondering if this is really so.
According to this tutorial the answer is YES: you have to do it every time.
One workaround is to use
use-package which allows you to configure a bunch of options after loading, including keybindings.