Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I bind to s-up?

Tags:

emacs

I'm trying to do this

(global-set-key (kbd "s-up") 'beginning-of-buffer)

and I get this error

error "s- must prefix a single character, not up"

How do I tell it to do this?

like image 885
jshen Avatar asked Jul 23 '12 20:07

jshen


2 Answers

Named keys should be written in angle brackets like this:

(kbd "s-<up>")

The exceptions to this are RET, SPC, TAB, DEL, LFD, ESC, and NUL, which must be in uppercase. See the documentation for edmacro-mode (C-h f edmacro-mode) for a more complete explanation of the syntax kbd accepts.

Also note that the s- prefix is for the super modifier, and S- is for shift.

like image 135
ataylor Avatar answered Nov 15 '22 11:11

ataylor


(global-set-key (kbd "S-<up>") 'beginning-of-buffer)
like image 30
Eric Johnson Avatar answered Nov 15 '22 10:11

Eric Johnson