xcode 如何禁用Xcode的自动缩进?

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

How to disable the auto-indentation of Xcode?

xcodeindentation

提问by JASON

How can I disable the feature that when I hit "return" the cursor will be placed on the next line with tabs?

如何禁用当我点击“返回”时光标将放置在带有制表符的下一行的功能?

回答by Xiao

Xcode - preference(or press keys command+,) - Indentations

Xcode - 首选项(或按键 command+,) - 缩进

There you can disable it.

在那里你可以禁用它。

回答by holroy

For Xcode 7(and presumably from at least Xcode 5) you can turn off auto indentation from preferences. That is either hit command+,(i.e. comma), or Xcode > Preferences..., and then select Text Editing > Indentationswhere you can remove the tick in front of Automatically indent based on syntaxclose to the middle of page.

对于Xcode 7(大概至少来自 Xcode 5),您可以从首选项中关闭自动缩进。那要么是点击command+,(即逗号),要么是Xcode > Preferences...,然后选择Text Editing > Indentations,您可以在其中删除自动缩进前面的勾号,该勾号基于接近页面中间的语法

回答by SteveS

Exact Steps For XCode 3.2.6:

XCode 3.2.6 的确切步骤:

XCode, Preferences, Indentation, "Syntax Aware Indenting" Section,

XCode,首选项,缩进,“语法感知缩进”部分,

Under "Automatically indented characters", uncheck "Return"

在“自动缩进字符”下,取消选中“返回”

Also, The XCode User Defaultsdocument from Apple (which may require a devloper login to view), provides much more fine grained control over the XCode IDE.

此外,来自 Apple的XCode 用户默认文档(可能需要开发人员登录才能查看)提供了对 XCode IDE 的更细粒度的控制。

To set and then readback indivdual settings use something like:

要设置然后回读个人设置,请使用以下内容:

defaults write com.apple.XCODE PBXIndentOnPaste No
defaults read com.apple.XCODE PBXIndentOnPast

回答by aholub

The XCode User Defaults document is obscolete for Xcode 6 --- at least none of the things that it documents seem to work any more. Also, there's no way to turn off auto indent (in the sense of matching the indent level of the previous line) from the Preferences menu. Disabling all options in that menu does not disable this behavior. Anybody have any how to actually solve this problem?

XCode 用户默认值文档对于 Xcode 6 来说已经过时了——至少它记录的所有内容似乎都不再起作用了。此外,无法从“首选项”菜单中关闭自动缩进(在匹配上一行的缩进级别的意义上)。禁用该菜单中的所有选项不会禁用此行为。任何人有任何如何实际解决这个问题?