Reputation: 530
I'm a Vim user, and I decided to give Emacs a try.
Now I get a weird problem with Emacs. I installed the Evil mode, which is awesome.
In my .emacs I have the follow setting:
(define-key evil-motion-state-map "\C-u" 'scroll-up-command)
This works well.
But what if I wanted to change it to spacebar or Return key?
(define-key evil-motion-state-map "<return>" 'scroll-up-command)
(define-key evil-motion-state-map "SPC" 'scroll-up-command)
Nothing spectular will happen, the return/Enter key and spacebar are behaving their standard behaviour. I looked around for the right keys, and it seems they're the rights keys. For example,
(global-set-key (kbd "<return>") 'save-buffer)
Works fine.
What am I doing wrong in Emacs/Evil with the Enter key?
Upvotes: 1
Views: 156
Reputation: 30718
Use (kbd "<return>")
, not "<return>"
. Likewise, (kbd "SPC")
.
You probably want (kbd "RET")
, not (kbd "<return>")
.
Binding C-u
, as you did at first, is a bad idea. You do not want to do that, ever. Just use C-u
as it was intended, for command universal-argument
-- see the Emacs manual, node Arguments
.
Upvotes: 2