1

I'm currently in the process of changing my emacs configuration quite extensively. I'm not comfortable with the default key-bindings for a lot of the major and minor modes and my configuration consists of undefining a lot of keys and replacing them with my own, the changes are quite radical.

I was wondering if there was a way to completely change the keymaps for certain modes. As an example, let's say we are changing the keys for the dired major mode, rather than have a list of local-unset-key's then a set of local-set-key within a hook for dired-mode-hook. Is there a way of setting the keys for a blank keymap such as with the make-sparse-keymap then replace the default dired-mode-map with the newly created one? There's probably a really simply way to achieve this but I'm struggling with elisp at the moment.

Doing this would make my configuration files a lot cleaner I feel.

2
  • Why do you have to unset keys? I just use local-set-key in the hook to overrides keys which I use and the keys I don't use don't matter, because I don't press them anyway.
    – Tom
    Jul 13, 2012 at 18:36
  • Its simply a matter of forcing myself to use the new keybindings which help to keep my fingers on the home row.
    – rfcoder89
    Jul 14, 2012 at 12:51

1 Answer 1

1

See use-local-map. For more information refer to this: http://www.gnu.org/software/emacs/manual/html_node/elisp/Controlling-Active-Maps.html

1
  • This is exactly what I needed thank you very much :)
    – rfcoder89
    Jul 14, 2012 at 12:50

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .