9

I want avoid using arrow keys for navigation within emacs however due to being an habit its difficult to switch to native key bindings of emacs for navigation. I would rather like to disable arrow keys in order to avoid it completely. How can i disable arrow keys in emacs?

  • 1
    Disabling cursors is one thing, but doing C-s C-r search style navigation, is better. – ocodo Dec 30 '12 at 6:19
10

Put this Elisp code at the bottom of your ~/.emacs startup file:

(global-unset-key (kbd "<left>"))
(global-unset-key (kbd "<right>"))
(global-unset-key (kbd "<up>"))
(global-unset-key (kbd "<down>"))
(global-unset-key (kbd "<C-left>"))
(global-unset-key (kbd "<C-right>"))
(global-unset-key (kbd "<C-up>"))
(global-unset-key (kbd "<C-down>"))
(global-unset-key (kbd "<M-left>"))
(global-unset-key (kbd "<M-right>"))
(global-unset-key (kbd "<M-up>"))
(global-unset-key (kbd "<M-down>"))

and then restart Emacs. If you don't want to disable the Ctrl (C-)and Alt (M-) variants, just leave those sections out.

1

This link is prob also relevant (its what I have just started using):

http://danamlund.dk/emacs/no-easy-keys.html

  • At the moment, this post is essentially only a link. To make sure the answer remains useful even if the link breaks, please edit it to include the relevant information. (Your answer was discovered in an effort to repair or remove old link-only answers.) – Ben N Jan 10 '16 at 5:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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