Search code examples
xcode

Change how home and end keys work in XCode


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?


Solution

  • 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+.