更改 XCode 中 home 键和 end 键的工作方式
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/3443792/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Change how home and end keys work in XCode
提问by node ninja
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?
当我按下 End 键时,我希望它把我带到行尾。同样,当我按下 Home 键时,我希望它能够将我带到行的开头。但在 Xcode 中,这些导航到页面的顶部和底部。如何改变这种情况?
回答by Brock Woolf
Xcode > Preferences > Key Bindings > Text Key Bindings
Xcode > 首选项 > 键绑定 > 文本键绑定
Then find these two:
然后找到这两个:
- Move to beginning of line
- Move to end of line
- 移至行首
- 移至行尾
Assign Homeand Endto these respectively.
分别分配Home和End给这些。
If you're doing this, don't forget to update Move to Beginning/End of Line Extending Selection, too and assign ? ShiftHomeand ? ShiftEnd, respectively. This will continue the desired behaviour when you have ? Shiftpressed.
如果您这样做,请不要忘记更新Move to Beginning/End of Line Extending Selection,? ShiftHome并? ShiftEnd分别分配和。当您? Shift按下时,这将继续所需的行为。
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+←.
仅供参考:? Cmd+→和? Cmd+←是通常在 Mac 上完成的方式。如果您来自 Windows,我会尝试适应这一点。如果要在单词之间跳转,可以使用Alt+ →, Alt+ ←。
回答by zneak
Go to Xcode -> Preferences... -> Key Bindings, tab Text Key Bindings, and change them to whatever you want.
转到 Xcode -> Preferences... -> Key Bindings,标签 Text Key Bindings,并将它们更改为您想要的任何内容。
回答by Wex
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:
如果您追求的是“智能家居”,那么按 Home 键会将您带到该行文本的开头,再按一次会将您带到该行的开头……那么您会想要这个: