67

When I press the End key I expect it to bring me to the end of the line. Likewise when I press the Home key I expect it to bring me to the beginning of the line. In Xcode though, these navigate to the top and bottom of the page. How can this be changed?

2

3 Answers 3

131

Xcode > Preferences > Key Bindings > Text Key Bindings

Then find these two:

  • Move to beginning of line
  • Move to end of line

Assign Home and End to these respectively.

If you're doing this, don't forget to update Move to Beginning/End of Line Extending Selection, too and assign ⇧ ShiftHome and ⇧ ShiftEnd, respectively. This will continue the desired behaviour when you have ⇧ Shift pressed.

You will also have to remove the conflicts that appear.

FYI: ⌘ Cmd+ and ⌘ Cmd+ are the way things are normally done on a Mac. If you are coming from Windows I would try to adjust to this. If you want to jump between words, you can use Alt+, Alt+.

9
  • 13
    See also: Move to Beginning/End of Line Extending Selection and assign Shift+Home/End to keep text selection consistent with those keys as well. Aug 12, 2012 at 12:29
  • 2
    You have single handedly saved Xcode for me! +10 if I could.
    – C.J.
    Mar 11, 2014 at 9:02
  • 3
    Oh my goodness, thank you. My blood pressure goes up everytime I Fn-Left arrow and XCode jumps me away from my work, unlike most other editors Mar 20, 2014 at 15:56
  • 6
    Another example of how Apple stuff is just soooooo easy! Ugh.
    – NightMICU
    Jan 19, 2015 at 20:56
  • 5
    I wish I could upvote this answer a thousand more times - I was going crazy.
    – lost baby
    Jul 27, 2017 at 20:01
4

Go to Xcode -> Preferences... -> Key Bindings, tab Text Key Bindings, and change them to whatever you want.

3
  • How ??? Went there, identified Move to End of Line, selected it, pressed End and...it scrolled me to the end of the list...?!?!?! Damn it, Apple... Apr 21, 2020 at 21:57
  • LE: nevermind...selection needs to happen to the far right, and it will take the key binding... Apr 21, 2020 at 22:16
  • Florin, look at "Move to End of Text"/"Move to Beginning of Text" keys Aug 25 at 12:33
2

If you're after 'smart home', where pressing the Home key takes you to the start of the text on that line, and a second-press takes you to the start of the line... then you'll be wanting this:

https://github.com/insanehunter/XCode4_beginning_of_line

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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