I know there is an existing shortcut to do this but I'd like to have the home key mapped to beginning-of-line instead of beginning-of-buffer.

I tried putting this in my ~/.emacs file but it seems like it is still being overwritten somehow:

(global-set-key [kp-home]  'beginning-of-line) ; [Home]
(global-set-key [home]     'beginning-of-line) ; [Home]

On that note, if anyone knows where the default keybindings are set when using emacs on FreeBSD I might be able to modify that file if it is overriding my .emacs.

EDIT: I am using FreeBSD 8.2 and accessing it through SSH/PuTTY.

This is my full .emacs file (nothing too crazy as you can see):

(keyboard-translate ?\C-h ?\C-?)

(add-to-list 'load-path "/home/sam/programs/go/go/misc/emacs/" t)
(require 'go-mode-load)

(global-set-key [kp-home]  'beginning-of-line) ; [Home]
(global-set-key [home]     'beginning-of-line) ; [Home]
link|improve this question
This may or may not be related, but what OS are you using? You mention FreeBSD, but it's in a side note, so it's not entirely clear (at least to me) that it's the same as your main question. – Shauna Jun 16 '11 at 16:57
Your code seems correct. Can you try a .emacs containing just these two lines? – maxelost Jun 17 '11 at 12:18
feedback

2 Answers

up vote 1 down vote accepted

Give this a try:

(global-set-key (kbd "<home>") 'move-beginning-of-line)
link|improve this answer
For my FreeBSD 9 system "<home>" does not work, but "<begin>" does. – goertzenator Dec 22 '11 at 16:07
feedback

I use:

(define-key global-map [home] 'beginning-of-line)

Your way seems like it should work too. Another suggestion to help you debug the problem. Hit C-h k [home] and it should show you what home is bound to and that may also give a clue what is setting it.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

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