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?
3 Answers
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+←.
-
13See 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
-
3Oh 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
-
5I wish I could upvote this answer a thousand more times - I was going crazy. Jul 27, 2017 at 20:01
Go to Xcode -> Preferences... -> Key Bindings, tab Text Key Bindings, and change them to whatever you want.
-
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
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: