Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Anyone knows what needs changing in OSX .emacs to get Command-left to act as C-a and move the cursor to beginning of line? The same for Command-right, I'd like to map it to move the cursor to end of line.

Thx!

share|improve this question
    
    
Thx Sonia, but I already knew how to do that. What I was asking here is how to get to the beginning or end of line. – Galder Zamarreño May 15 '12 at 16:57
up vote 5 down vote accepted

Found it!

(global-set-key (kbd "<s-right>") 'move-end-of-line)
(global-set-key (kbd "<s-left>") 'move-beginning-of-line)
share|improve this answer

For a generic method see http://superuser.com/a/418251/130126

share|improve this answer
    
Sorry but I don't understand that method. – Galder Zamarreño May 3 '12 at 9:45
    
Argh!! I tried to link to my answer, but for some reason you have to scoll up a bit. <br> – fstx May 3 '12 at 16:19
    
Do C-h k followed by C-x 5 2 to get the name of the function that you want to reassign. Do M-x global-set-key <return>, press the key you want to assign it to, and then type the name of the function. Do C-x ESC ESC and copy the lisp expression to your .emacs – fstx May 3 '12 at 16:21

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .