如何设置键盘 s-up 以将光标移动到 emacs 缓冲区的开头(以及 s-down 以将光标移动到缓冲区的末尾)?
How to set keyboard s-up to go move cursor to start of buffer in emacs (and s-down to move cursor to end of buffer)?
当我按下 s-up
(即按住 "command" 键,按下 "up" macOS 上的键),等同于 s-down
?
我知道应该是这样的 (global-set-key (kbd "s-<up>") ... )
(global-set-key (kbd "s-<up>") 'beginning-of-buffer)
(global-set-key (kbd "s-<down>") 'end-of-buffer)
您可以使用 C-h k
.
找出给定键绑定的命令
在这种情况下,M-<
将您带到缓冲区的开头,C-h k M-<
告诉您:
M-<
runs the command beginning-of-buffer
, which is an interactive
compiled Lisp function in simple.el
.
It is bound to begin
, C-home
, M-<
, menu-bar search goto beg-of-buf
.
(beginning-of-buffer &optional ARG)
Move point to the beginning of the buffer.
With numeric arg N
, put point N
/10 of the way from the beginning.
If the buffer is narrowed, this command uses the beginning of the
accessible part of the buffer.
If Transient Mark mode is disabled, leave mark at previous
position, unless a C-u
prefix is supplied.
Don't use this command in Lisp programs!
(goto-char (point-min))
is faster.
同样,对于M->
,它绑定到end-of-buffer
。
当我按下 s-up
(即按住 "command" 键,按下 "up" macOS 上的键),等同于 s-down
?
我知道应该是这样的 (global-set-key (kbd "s-<up>") ... )
(global-set-key (kbd "s-<up>") 'beginning-of-buffer)
(global-set-key (kbd "s-<down>") 'end-of-buffer)
您可以使用 C-h k
.
在这种情况下,M-<
将您带到缓冲区的开头,C-h k M-<
告诉您:
M-<
runs the commandbeginning-of-buffer
, which is an interactive compiled Lisp function insimple.el
.It is bound to
begin
,C-home
,M-<
,menu-bar search goto beg-of-buf
.
(beginning-of-buffer &optional ARG)
Move point to the beginning of the buffer.
With numeric arg
N
, put pointN
/10 of the way from the beginning.If the buffer is narrowed, this command uses the beginning of the accessible part of the buffer.
If Transient Mark mode is disabled, leave mark at previous position, unless a
C-u
prefix is supplied.Don't use this command in Lisp programs!
(goto-char (point-min))
is faster.
同样,对于M->
,它绑定到end-of-buffer
。