Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.

share|improve this question
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 '12 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 '12 at 12:51
up vote 1 down vote accepted

See use-local-map. For more information refer to this:

share|improve this answer
This is exactly what I needed thank you very much :) – rfcoder89 Jul 14 '12 at 12:50

You must log in to answer this question.

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