I wanted to disable arrow keys in my Emacs to practice vim key bindings using EVIL mode.
So instead of using global-unset-key
as someone here on stackexchange suggested. I used the following code in my init file.
(global-set-key (kbd "<left>") (lambda() ( message "Use Vim keys: h for Left")))
(global-set-key (kbd "<right>") (lambda() (message "Use Vim keys: l for Right")))
(global-set-key (kbd "<up>") (lambda() (message "Use Vim keys: k for Up")))
(global-set-key (kbd "<down>") (lambda() (message "Use Vim keys: j for Down")))
For some reason these don't work inside org-mode
.
And also if I am not inside org-mode
, It works but instead of the message like I want to give. I get the following error.
command-execute: Wrong type argument: commandp, (lambda nil (message "Use Vim keys: h for Left"))
Complete Beginner here. So fix along with some explanation of how things work is highly appreciated.
Edit:
After the first answer I see that the error has vanished. But the whole thing doesn't work unless I type something. Not as soon as I enter Emacs.
And the error is not specific to org-mode
. It also works in org-mode
after I type something.
It doesn't work in normal-mode in EVIL.