Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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
add comment

1 Answer

up vote 1 down vote accepted

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

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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.