On Linux, I am able to move the cursor to start of buffer/end of buffer using using C-Home/C-End respectively:

C-End       Move cursor to the end of the buffer. Note the key is 'End' key on the keyboard.
C-Home      Move cursor to the beginning of the buffer.

However, on Mac OSX, I am unable to perform this simple operation. First, there is no HOME or END key. Second, supposedly, these keys are supposed to be the substitute:

begin   M-<     ⌘↑
end     M->     ⌘↓

But M-< and M-> are reserved for something else. And ⌘↑ and ⌘↓ are undefined. Only experience this issue with OSX. How should I resolve it?

  • 1
    Have you tried binding the keys you want to what you want them to be?
    – zck
    Dec 1 '19 at 22:30
  • 1
    I'm pretty sure you can use fn left-arrow and fn right-arrow to invoke home and end?
    – shoshin
    Dec 2 '19 at 3:10

What M-< and M-> are reserved for in your config? By default (emacs -Q) they are bound to beginning-of-buffer and end-of-buffer respectively. Even if they bound to something else, you can make ⌘↑ and ⌘↓ do the work:

(global-set-key (kbd "s-<up>") #'beginning-of-buffer)
(global-set-key (kbd "s-<down>") #'end-of-buffer)

M-< and M-> should work unless bound otherwise. I usually test things using F1 help key F1-k which should prompt you for the key binding to test, in this case enter M-< and see what it is bound to, if anything.

For me, I get:

⌥< (translated from <escape> <) runs the command beginning-of-buffer
(found in global-map), which is an interactive compiled Lisp function
in ‘simple.el’.

It is bound to <home>, <A-up>, <A-prior>, <kp-home>, <begin>, ⌥<,
<menu-bar> <edit> <goto> <beg-of-buf>.

(beginning-of-buffer &optional ARG)

This function is for interactive use only;
in Lisp code use `(goto-char (point-min))' instead.

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.

Push mark at previous position, unless either a ^U prefix
is supplied, or Transient Mark mode is enabled and the mark is active.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.