I'd like to bind ⌘← and ⌘→ on Terminal.app to going to the start and end of the line respectively so it behaves like any (almost) other program in Mac OS X. Is it possible?

I went to Preferences and to configure key bindings and the only modifier keys are control, option, none and shift.

link|improve this question

69% accept rate
Yes, fideli, apparently it's impossible. If you want to add a question stating that it is impossible, I'll accept it. – J. Pablo Fernández Dec 12 '09 at 11:47
feedback

4 Answers

up vote 2 down vote accepted

This may not be possible because ⌘← and ⌘→ change focus between multiple Terminal windows, a functionality that appears to be built-in. I checked out the Secrets Preference Pane for Terminal and there doesn't seem to be anything there.

Having said that, a similar move that's convenient on MacBook or MacBook Pro keyboards is ⇧fn← and ⇧fn→, which correspond to ⇧↖ and ⇧↘.

link|improve this answer
⇧⌃← and ⇧⌃→ seem to move only one character with the default config. Am I doing something wrong? – J. Pablo Fernández Dec 12 '09 at 15:02
Ah, my mistake. I was doing ⇧fn← and ⇧fn→ on my MacBook, which correspond to ⇧↖ and ⇧↘. I'll edit my response, although I suppose it's only somewhat convenient on the MacBook or MacBook Pro keyboard, and not on the regular Apple keyboard. – fideli Dec 12 '09 at 15:41
You can override the default shortcuts using the OSX Keyboard & Mouse preference pane. – donut Apr 14 '10 at 3:47
feedback

It's not an answer to your question , but in Terminal.app (using bash) ctrl+a jumps to the beginning of the line, and ctrl+e jumps to the end.

link|improve this answer
1  
Yes, I could also configure home and end to do it, but I like to keep my shortcuts as uniform as possible. – J. Pablo Fernández Dec 10 '09 at 19:13
1  
It would seem ^a and ^e work in the GUI programs. Perhaps these are what you should use for your universal shortcuts. – Nerdling Dec 10 '09 at 20:30
feedback

I have actually psueodo bound this by using controllermate to emulate ⇧↖ and ⇧↘ on using ⌘← and ⌘→, and attaching it to terminal as the focussed application. works like a dream.

link|improve this answer
feedback

Maybe not what you want, but I've found that the emacs ^A and ^E seem to work in a lot of mac applications, so it might be easier to rewire your habits to use these keys instead?

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.