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?
2 Answers
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.
This link is prob also relevant (its what I have just started using):
-
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 NJan 10, 2016 at 5:03
C-s
C-r
search style navigation, is better.