Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Change how home and end keys work in XCode

Tags:

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?

like image 888
node ninja Avatar asked Aug 09 '10 20:08

node ninja


People also ask

What is the End key on a laptop?

The End key is a key found on a computer keyboard that moves the cursor to the end of the line, document, page, cell, or screen.


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

like image 71
Brock Woolf Avatar answered Nov 10 '22 22:11

Brock Woolf


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

like image 30
zneak Avatar answered Nov 10 '22 21:11

zneak