XCode 使用 TAB 对多行代码进行制表

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/15578716/
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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 03:02:51  来源:igfitidea点击:

XCode Using TAB to tab multiple lines of code

xcodekeyboard-shortcutscustomizationkey-bindings

提问by user-44651

enter image description hereIs it possible to select multiple lines of code in XCode and when I press TABbutton all those selected lines indent?

在此处输入图片说明是否可以在 XCode 中选择多行代码,当我按下TAB按钮时,所有选定的行都缩进了?

I know CMD+[will indenet and CMD+]will undent. But I want that same principle to happen to 'TABandSHIFT+TAB`.

我知道CMD+[会 indenet 和CMD+]undent。但我希望同样的原则也适用于“TAB andSHIFT+TAB”。

Right now, it just deletes the highlighted lines when TAB is used to the Structure Keybinding. I can't get my keybindings to work right. Anyone know what I might be doing wrong?

现在,当 TAB 用于结构键绑定时,它只是删除突出显示的行。我无法让我的键绑定正常工作。有谁知道我可能做错了什么?

回答by Hyman Wilson

I was able to replace the shift right [ with a tab and the shift left ] with Shift-tab. Just double click on the present key binding and press TAB or Shift TAB. However I've seen that Xcode doesn't always apply the settings right away so it wouldn't hurt to restart it.

我能够用 Shift-tab 替换右移 [ 用制表符和左移 ]。只需双击当前键绑定并按 TAB 或 Shift TAB。但是我已经看到 Xcode 并不总是立即应用设置,因此重新启动它不会有什么坏处。

回答by Janene Pappas

Look in your Xcode Preferences, under Key Bindings. You can search for the current bindings by typing "TAB" in the search field. You may need to delete some current bindings to get yours to be in effect.

查看您的 Xcode 首选项,在 Key Bindings 下。您可以通过在搜索字段中键入“TAB”来搜索当前绑定。您可能需要删除一些当前绑定才能使您的绑定生效。